Created
April 12, 2010 19:04
-
-
Save jedschneider/363889 to your computer and use it in GitHub Desktop.
This file contains 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
class Answer< ActiveRecord::Base | |
validate :my_custom_validation | |
def my_custom_validation | |
errors.add "All whammies, no money" if value.blank? | |
end | |
end | |
class Survey<ActiveRecord::Base | |
has_many :answers | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment