Hi All, I have the following test case which worked just fine before I upgraded to rails 1.2.1: def test_update_settings assert @unit.setting!=nil # loaded via fixtures assert_equal @unit.setting,@current_setting # also loaded via fixtures @unit.setting.mode = true assert @unit.save @unit.reload assert @unit.setting.mode end where @unit is declared with ''has_one :setting'' setting and setting is declared as ''belongs_to: unit'' After I upgraded to rails 1.2.1 ''@unit.save'' stopped cascading the update on setting and as a consequence the last assert fails. When I check the log I see that no update happens on the child (setting). Do I miss anything? Can someone confirm whether it works or broken? Regards, Siarhei -- 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 -~----------~----~----~----~------~----~------~--~---
> When I > check the log I see that no update happens on the child (setting). Do I > miss anything? Can someone confirm whether it works or broken?Have you checked to see if any validations are failing on the child model? If you update a child via a parent and validations fail, rails will fail the save silently and you''ll see no sql update in the logs. Steve --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Stephen Bartholomew wrote:>> When I >> check the log I see that no update happens on the child (setting). Do I >> miss anything? Can someone confirm whether it works or broken? > Have you checked to see if any validations are failing on the child > model? If you update a child via a parent and validations fail, rails > will fail the save silently and you''ll see no sql update in the > logs.Yes I tried that and the child was valid. -- 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 -~----------~----~----~----~------~----~------~--~---
Reasonably Related Threads
- Rails 1.2.1 reload of active record changed?
- PostgreSQL CASCADE not copied to test db
- @model.errors.empty? => true; @model.valid? => false
- [LLVMdev] ARM ELF target and the use of VFP/NEON instructions
- [LLVMdev] ARM ELF target and the use of VFP/NEON instructions