Is Rails designed to validate differently with the has_one model association or is it a bug? I find myself having to code around my validation differently and wasn''t sure if others thought it was an issue as well. For example if employee HAS_ONE manager: my_employee.manager = invalid_manager my_employee.save => true Shouldn''t my_employee.save return false since the invalid_manager was unable to save? Thanks, Tom --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 9/5/07, TomRossi7 <tom-5bxIUPmzHicFraO2wh7vUA@public.gmane.org> wrote:> > Is Rails designed to validate differently with the has_one model > association or is it a bug? I find myself having to code around my > validation differently and wasn''t sure if others thought it was an > issue as well. > > For example if employee HAS_ONE manager: > > my_employee.manager = invalid_manager > my_employee.save > => true > > Shouldn''t my_employee.save return false since the invalid_manager was > unable to save?you need to use validates_associated http://api.rubyonrails.com/classes/ActiveRecord/Validations/ClassMethods.html#M000948 Adam --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---