I''d like to use autosave => true for an association for its added benefits: the parent doesn''t save unless the children saves. However, it seems to skip validations when saving the children. And this seems to be the case since the beginning of time... Anyone know why? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/EWGmrdv0DGIJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
On Monday, 9 July 2012 20:37:32 UTC-4, bubbler wrote:> > I''d like to use autosave => true for an association for its added > benefits: the parent doesn''t save unless the children saves. However, it > seems to skip validations when saving the children. And this seems to be > the case since the beginning of time... > > Anyone know why? >Sometimes it''s useful - if you want the save to fail if any child has errors, use validates_associated: http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#method-i-validates_associated --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/A98A3OW79ooJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
Seemingly Similar Threads
- conditional validates_associated
- Windows editor suggestions - autosave
- DO NOT REPLY [Bug 4873] New: rsync transfers stop when encountering Emacs autosave files with hash signs
- Rails ActiveRecord associations autosave option
- Validating an ActiveRecord object and its has_many :through associations