In fact, when playing in the console, I could see that assigning 
association_attributes an empty hash does not empty task_id:

irb(main):001:0> require 'factory_girl_rails'
=> true
irb(main):002:0> t=FactoryGirl.build(:submitted_timesheet)
irb(main):004:0> t.activities
=> [#<Activity id: nil, timesheet_id: nil, task_id: 4, created_at: nil, 
updated_at: nil>]
irb(main):003:0> t.activities_attributes = {}
=> {}
irb(main):004:0> t.activities
=> [#<Activity id: nil, timesheet_id: nil, task_id: 4, created_at: nil, 
updated_at: nil>]

I believed that it would be the case ...

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msg/rspec/-/okzX-NizCWsJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to