Sunday, February 13, 2011

[Rails] ActoveRecord values to columns assignation

Hi
I have problem with ActiveRecord I have generated model by script/
generate model account_unapid auction_id:integer
allegro_user_id:integer user_data_id:integer account_type:string
account_type_id:integer send:integer then I tried to use this model :
>> a = AccountUnapid.new
=> #<AccountUnapid id: nil, auction_id: nil, allegro_user_id: nil,
user_data_id: nil, account_type: nil, account_type_id: nil, send: nil,
created_at: nil, updated_at: nil>
>> a.auction_id = 1
ArgumentError: wrong number of arguments (2 for 0)
from /usr/lib/ruby/1.8/active_record/attribute_methods.rb:
244:in `send'
from /usr/lib/ruby/1.8/active_record/attribute_methods.rb:
244:in `method_missing'
from (irb):3
What is the problem ? I tried this on empty rails app and I tried to
assign values by attributes = but I have still error.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate