Skip to content

brontes3d/validates_presence_of_association

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ValidatesPresenceOfAssociation

The rails suggested thing to do is

validates_presence_of :user_id

instead of

validates_presence_of :user But sometimes there are circular references in your models, and it’s sometimes impossible to come up with a save order that allows all the validations like this to pass.

so instead this plugin lets you

validates_presence_of_association :user which causes a validation that at least one of :user_id and :user is set. (if one is set, no need to check the other)

Copyright © 2008-2010 3M. All rights reserved. Released under the MIT license.

Authored by Jacob Burkhart.

About

validates_presence_of something_id wasn't cutting it

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages