Hi, I am using rails 2.0.2 and when trying to edit table data the corresponding controller fires an argument error for the update method. I already tried to delete the plugins (except the globalize plugin) but nothing changes. Has anyone an idea what is wrong? Here is the trace: c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2245:in `attributes_with_quotes'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2245:in `update_without_lock'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/locking/optimistic.rb:70:in `update_without_callbacks'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:240:in `update_without_timestamps'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/timestamp.rb:38:in `globalize_old_update'' vendor/plugins/for-1.2/lib/globalize/localization/db_translate.rb:702:in `update'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2238:in `create_or_update_without_callbacks'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:213:in `globalize_old_create_or_update'' vendor/plugins/for-1.2/lib/globalize/localization/db_translate.rb:695:in `create_or_update'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1972:in `save_without_validation'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/validations.rb:934:in `save_without_transactions'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:108:in `save'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:80:in `transaction'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:100:in `transaction'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:108:in `save'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:120:in `rollback_active_record_state!'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:108:in `save'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2034:in `update_attributes'' app/controllers/activities_controller.rb:63:in `update'' app/controllers/activities_controller.rb:62:in `update'' -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Mar-12 18:30 UTC
Re: Argument error "wrong number of aguments (2 for 1)"
On 12 Mar 2008, at 18:11, Jochen Kempf wrote:> > Hi, > > I am using rails 2.0.2 and when trying to edit table data the > corresponding controller fires an argument error for the update > method. > > I already tried to delete the plugins (except the globalize plugin) > but > nothing changes. > > Has anyone an idea what is wrong?Well have you tried removing the globalize plugin? I find it a little suspicious that you;re loading a plugin in a directory called ''for-1.2'' when your app is running 2.0. Fred> > > Here is the trace: > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > base.rb:2245:in > `attributes_with_quotes'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > base.rb:2245:in > `update_without_lock'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > locking/optimistic.rb:70:in > `update_without_callbacks'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > callbacks.rb:240:in > `update_without_timestamps'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > timestamp.rb:38:in > `globalize_old_update'' > vendor/plugins/for-1.2/lib/globalize/localization/db_translate.rb: > 702:in > `update'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > base.rb:2238:in > `create_or_update_without_callbacks'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > callbacks.rb:213:in > `globalize_old_create_or_update'' > vendor/plugins/for-1.2/lib/globalize/localization/db_translate.rb: > 695:in > `create_or_update'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > base.rb:1972:in > `save_without_validation'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > validations.rb:934:in > `save_without_transactions'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > transactions.rb:108:in > `save'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > connection_adapters/abstract/database_statements.rb:66:in > `transaction'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > transactions.rb:80:in > `transaction'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > transactions.rb:100:in > `transaction'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > transactions.rb:108:in > `save'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > transactions.rb:120:in > `rollback_active_record_state!'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > transactions.rb:108:in > `save'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > base.rb:2034:in > `update_attributes'' > app/controllers/activities_controller.rb:63:in `update'' > app/controllers/activities_controller.rb:62:in `update'' > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jochen Kempf
2008-Mar-13 21:26 UTC
Re: Argument error "wrong number of aguments (2 for 1)"
Frederick Cheung wrote:> On 12 Mar 2008, at 18:11, Jochen Kempf wrote: > >> >> Has anyone an idea what is wrong? > > Well have you tried removing the globalize plugin? I find it a little > suspicious that you;re loading a plugin in a directory called > ''for-1.2'' when your app is running 2.0. > > FredHi Fred, well - you are right that the problem is the Globalize (for-1.2) plugin but I wondered what was the problem. Finally I figured out that the problem occurs when switching on the model translation vía "translates :method" in the corresponding model. However, I do not know how to fix that as I still do not know a lot about Ruby and Rails but I will make a trial with keeping translations in the model and see what happens. Jochen -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---
Jochen Kempf
2008-Mar-13 21:37 UTC
Re: Argument error "wrong number of aguments (2 for 1)"
Ok, and here is the corresponding ticket with patch to fix it: http://trac.globalize-rails.org/trac/globalize/ticket/184 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---