NOTE: This validation will not fail if the association hasn‘t been assigned. If you want to ensure that the association is both present and guaranteed to be valid, you also need to use validates_presence_of.