activerecord-2.3.14 breaks with ruby 1.9.2 in collection_accessor_methods() at line 1336 of lib/activerecord/associations.rb #3434

Closed
pydi opened this Issue Oct 25, 2011 · 4 comments

Comments

Projects
None yet
2 participants

pydi commented Oct 25, 2011

undefined method `reject' for "4":String is thrown when I try to perform @user.update_attributes(params).

The params list is as follows

"user"=>{"login"=>"admin", "first_name"=>"Admin", "last_name"=>"Admin", "email"=>"nfsurveytest+admin@neurofocus.com", "location_id"=>"1", "last_login_at_text"=>"Never logged in", "password"=>"", "password_confirmation"=>"", "role_ids"=>"4", "active"=>"true", "is_staff"=>"true"},


The error stack is as below

/home/narendra/.rvm/gems/ruby-1.9.2-p290@nf_schedule/gems/activerecord-2.3.14/lib/active_record/associations.rb:1336:in block in collection_accessor_methods' /home/narendra/.rvm/gems/ruby-1.9.2-p290@nf_schedule/gems/activerecord-2.3.14/lib/active_record/base.rb:2918:inblock in assign_attributes'
/home/narendra/.rvm/gems/ruby-1.9.2-p290@nf_schedule/gems/activerecord-2.3.14/lib/active_record/base.rb:2914:in each' /home/narendra/.rvm/gems/ruby-1.9.2-p290@nf_schedule/gems/activerecord-2.3.14/lib/active_record/base.rb:2914:inassign_attributes'
/home/narendra/.rvm/gems/ruby-1.9.2-p290@nf_schedule/gems/activerecord-2.3.14/lib/active_record/base.rb:2787:in attributes=' /home/narendra/.rvm/gems/ruby-1.9.2-p290@nf_schedule/gems/activerecord-2.3.14/lib/active_record/base.rb:2671:inupdate_attributes_inside_transaction'
/home/narendra/.rvm/gems/ruby-1.9.2-p290@nf_schedule/gems/activerecord-2.3.14/lib/active_record/transactions.rb:229:in block in with_transaction_returning_status' /home/narendra/.rvm/gems/ruby-1.9.2-p290@nf_schedule/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/database_statements.rb:136:intransaction'
/home/narendra/.rvm/gems/ruby-1.9.2-p290@nf_schedule/gems/activerecord-2.3.14/lib/active_record/transactions.rb:182:in transaction' /home/narendra/.rvm/gems/ruby-1.9.2-p290@nf_schedule/gems/activerecord-2.3.14/lib/active_record/transactions.rb:228:inwith_transaction_returning_status'
/home/narendra/.rvm/gems/ruby-1.9.2-p290@nf_schedule/gems/activerecord-2.3.14/lib/active_record/base.rb:2667:in update_attributes' /home/narendra/workspace/nf_schedule/app/controllers/users_controller.rb:100:inupdate'

I assume this breaks as String in ruby 1.9.2 does not mixin 'Enumerable'.

Can anyone confirm if this is an issue or I am missing something?

pydi closed this Oct 25, 2011

pydi reopened this Oct 25, 2011

pydi commented Oct 25, 2011

role_ids is rendered as radio_button in the form. So when role is selected the form params for role_ids is "role_ids"=>"4". Wondering if radio_button when submitted to form should be as "role_ids"=>["4"]

Member

arunagw commented Nov 30, 2011

We are not going to maintain any new version for 2.3.x version. Have you upgraded your APP already ??

pydi commented Nov 30, 2011

I did upgrade my app after checking the source code that there is no support for API changes for rails 2.3.X branch on ruby 1.9.2. I appreciate if you can point me to a location where I can find the supported ruby and rails versions matrix or some roadmap

Member

arunagw commented Nov 30, 2011

Cool that you have upgraded your APP. Now this issue can be closed :-)

You can always read stuff http://guides.rubyonrails.org/ Or post email on rubyonrails mailing list.

arunagw closed this Nov 30, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment