Can anyone figure out what\'s going on here? I was able to get my code to work the way I want it to, but I can\'t figure out why validates_associated isn\'t working as I ex
Man... all I got was that validates_presence_of
is needed for this to work as you got from the API. Seem's overkill to be checking for association validness, but I'm a noob.
validates_associated
simply runs the validations that are specified within the associated object's class, it does nothing in regard to foreign keys.
validates :user_id, :presence=>true
ensures the presence of a user_id
in your flag record, but that's all.
validates :user, :presence=>true
is used on the association itself and ensures that foreign keys are properly set up.