search for: create_

Displaying 15 results from an estimated 15 matches for "create_".

Did you mean: create
2006 Jun 23
1
instantiate record in single table inheritance
Hi, is there a way to instantiate a _concrete_ subtype from within an ActiveRecord collection? Example: class Link < ActiveRecord::Base end class InternalLink < Link end class ExternalLink < Link end internal_link = my_navigation.links.create_[xxxxxxx] external_link = my_navigation.links.create_[xxxxxxxx] the [xxx] is what I am missing... I could do this external_link = my_navigation.links.create(:type => ExternalLink.to_s) but in this case the validations of ExternalLink will no be processed, only of Link... please help *argh...
2009 Sep 13
1
belongs_to + create_* = rails vs. console behavior difference = confused Pepe
...... end The way things need to work is to first create an audit and after the audit is created a user that has access to the audit gets created. This has to work this way and not the other way around. I have been testing my code in the console with the following: audit = Audit.create(...) audit.create_user(...) In all instances ''audit'' ended up being updated correctly with the user ID. However, when I executed a very similar code in my controller I got different results. My original control code: @audit = Audit.new(params[:audit]) ... if @audit.save @audit.create_us...
2007 Nov 08
3
Downloading a file into a directory that does not exist
Hello again, all: When downloading a file from the puppetmaster''s fileserver, like so: ==========SNIP========== define install_file ($mode = 0644, $owner = ''root'', $group = ''root'') { file { "${name}": source => [ "puppet://${puppetserver}/dist/files/${name}_${operatingsystem}",
2008 Jan 11
5
Missing methods
We have a custom implementation of the Mother Object idea. It''s inside of a module, basically like this: module Factory %w(account friendship person invitation message asset email_address birth).each do |klass| eval <<-EOF def self.create_#{klass}(attributes = {}) default_attributes = valid_#{klass}_attributes #{klass.camelize}.create! default_attributes.merge(attributes) end EOF end def valid_message_attributes(options = {}) { #some message options } end #more valid_x_attributes methods end When I require this...
2006 Mar 23
2
Way to iterate over each associtaion
Is there a way with ActiveRecord to get ahold of a collection containing each association? I want to write a rake task that will dump a model and all its related models to yaml. Thanks, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060323/abdf4305/attachment.html
2007 Mar 20
0
ActionMailer template issues?
I''m using ActionMailer and it''s working fine when actually sending mail. I have a TestEmailController whose job it is to render sample versions of each email we send and show them in a browser for review by QA & our creative teams. Currently, I''m using the create_* method in ActionMailer, and then trying render :text => email.part[1]. When I do this, the text/html email part appears to be encoded for SMTP (I know zero about SMTP) and so I''ve got 3Ds and linebreaks all over my code. Is there some way to convert the email part back to HTML for re...
2006 Jan 02
2
Dynamic form tags
Hi all, I''m happily using "HowToReuseEditViewsForNewViews" found at: http://wiki.rubyonrails.com/rails/pages/HowToReuseEditViewsForNewViews There''s this comment there saying you only need the tag "<%= auto_form %>" when using the code below. Can somebody tell me if that will work when extending it with model_name (some how)? I have several new_*
2004 Oct 25
1
Rails 0.8: Just shy of 100 additions, changes, tweaks, and fixes!
...m7Ywyx6yg@public.gmane.org Subject: [Signed up] Welcome david-OiTZALl8rpK0mm7Ywyx6yg@public.gmane.org Hello there, Mr. david-OiTZALl8rpK0mm7Ywyx6yg@public.gmane.org You never actually call the instance methods like signed_up directly. Instead, you call class methods like deliver_* and create_* that are automatically created for each instance method. So if the signed_up method sat on ApplicationMailer, it would look like this: ApplicationMailer.create_signed_up("david-OiTZALl8rpK0mm7Ywyx6yg@public.gmane.org") # => tmail object for testing ApplicationMailer.deli...
2014 Sep 25
2
[PATCH] virtio_balloon: Convert "vballon" kthread into a workqueue
...the balloon() handler. Instead, another work item has to be scheduled from fill_balloon() and leak_balloon() when they do not do all requested changes in a single call. I think that performance is not the most critical thing in this case. Anyway, I tried to create the workqueue two ways: 1st create_freezable_workqueue("vballoon_wq"); 2nd alloc_workqueue("vballoon_wq", WQ_FREEZABLE | WQ_MEM_RECLAIM, 0); And then I tried to modify 10 times the size of a virtual host by ballooning between 20GB and 2GB. I got the following times: --------------------------------------...
2014 Sep 25
2
[PATCH] virtio_balloon: Convert "vballon" kthread into a workqueue
...the balloon() handler. Instead, another work item has to be scheduled from fill_balloon() and leak_balloon() when they do not do all requested changes in a single call. I think that performance is not the most critical thing in this case. Anyway, I tried to create the workqueue two ways: 1st create_freezable_workqueue("vballoon_wq"); 2nd alloc_workqueue("vballoon_wq", WQ_FREEZABLE | WQ_MEM_RECLAIM, 0); And then I tried to modify 10 times the size of a virtual host by ballooning between 20GB and 2GB. I got the following times: --------------------------------------...
2006 Aug 12
7
Documentation for wxRuby
...by parsing the LaTeX originals from wxWidgets and outputing a Rubyish version. These LaTeX files are then run thru tex2rtf to create the HTML docs. The attached file shows all the details, just drop it into the rake folder and add require "rake/rakedocs" to the main rakefile and also add create_documentation_tasks under all the other create_*_tasks in the main rakefile. Type rake -T to see the added tasks. All the requirements to run the doc tasks are at the top of the rakedocs.rb file. Feedback is welcome especially on the styling of the method names. I hope this email makes sense, I a...
2012 May 15
5
setting up the SQLite database
...me #from an old snippet 1.2 OR like this (postgres) example [Magnus]: def List.create List::Models::Base.establish_connection( :adapter => "postgresql", :username => "root", :password => "toor, :database => "list" ) List::Models.create_schema end 1.3 in a config/database.yml file [Magnus] (probably not worth it for SQLite): --- adapter: postgresql username: root password: toor database: mycampingdb And then do: require ''yaml'' def AppName.create AppName ::Models ::Base.establish_connection(YAML.load(Fi...
2008 Nov 30
11
rake aborted! undefined method `each' for #<Mysql:
I''m struggling with several problems getting my first time ruby on rails environment running. I''m now stuck on this problem too. rake db:migrate generates the following error. This one is on a vista machine. Anyone seen this before. Any thoughts or advice? Reading about Ruby on Rails has really got me excited to give it a try. But in practice getting to the point that I can
2008 Nov 21
0
Wine release 1.1.9
...ling of 'superseded'. Assorted spelling fixes. msxml3: Dynamically load libxslt.so and only call xsltInit() if present. ntdll/tests: Fix typos in test_NtQueryValueKey(). ntdll/tests: Test how NT(Set, Query)ValueKey() handle non-terminated strings. kernel32: Fix create_scsi_entry() so it puts properly '\0'-terminated strings in the registry. kernel32: Simplify and optimize create_(system,env)_registry_keys(). msxml3: Fix compilation on systems that don't have xsltInit(). regedit: Fix a buffer allocation in export_registry_key()....
2011 Oct 10
0
Wine release 1.3.30
...dpnet: Fixed bad pointer addition (Coverity). wpp: Add semicolons at end of code rules. dibdrv: Mark get_rop_codes as hidden. mscoree: Mark cordebug_init as hidden. mshtml: Mark replace_node_by_html as hidden. vbscript: Mark some symbols as hidden. msdaps: Mark create_* functions as hidden. dsound: Mark enum_callback and search_callback static. winex11.drv: Mark xrenderdrv_ExtTextOut as static. winmm: Mark two functions as hidden. ole32: Mark two functions as hidden. dsound: Make a function static, remove a no longer used array....