Created
March 26, 2009 20:41
-
-
Save ddollar/86318 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| validate :custom_validation_method | |
| def custom_validation_method | |
| if parent_object.has_stuff? && name.blank? | |
| errors.add :name, 'should not be blank when parent object has stuff' | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment