Displaying 1 result from an estimated 1 matches for "c9c7cfcd".
2006 Feb 16
1
validations with associated object
Does anyone know if Rails is supposed to validate associated objects on 
creation?
Say you have a User model, with has_many posts, and a Post model which 
belongs_to user.  Further, the Post model has a validates_uniqueness_of 
:title.
u = User.find(1)
# this should pass
u.posts.create :title => ''my new post title''
# this should fail
u.posts.create :title => ''my