#529 ✓resolved
Betelgeuse

Hobo association magic and rails autosave don't play well together

Reported by Betelgeuse | November 6th, 2009 @ 12:40 AM | in Hobo 1.0 - Final

(rdb:1) p c.save

ArgumentError Exception: wrong number of arguments (3 for 1)

upstream rails:

betelgeuse@pena /mnt/checkouts/rails $ grep "def insert_record" -r .
./activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb:        def insert_record(record, force = true, validate = true)
./activerecord/lib/active_record/associations/has_many_through_association.rb:        def insert_record(record, force = true, validate = true)
./activerecord/lib/active_record/associations/has_many_association.rb:        def insert_record(record, force = false, validate = true)

hobo:

betelgeuse@pena ~/hobo/hobo-git $ grep "def insert_record" -r .
./hobo/lib/hobo/permissions/associations.rb:          def insert_record(record)
./hobo/lib/hobo/permissions/associations.rb:          def insert_record(record, force=true)

You get here from:

(rdb:1) l =
[284, 293] in /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/autosave_association.rb
   284            records.each do |record|
   285              if autosave && record.marked_for_destruction?
   286                association.destroy(record)
   287              elsif @new_record_before_save || record.new_record?
   288                if autosave
=> 289                  association.send(:insert_record, record, false, false)
   290                else
   291                  association.send(:insert_record, record)
   292                end
   293              elsif autosave

I hit this with accepts_nested_attributes_for. I think hobo needs to gain support for the validate parameter.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Referenced by

Pages