Created
December 1, 2010 01:04
-
-
Save matthodan/722751 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
class User < ActiveRecord:Base | |
validate :user_is_happy_and_broke | |
private | |
def user_is_happy_and_broke | |
if self.state_of_mind != 'happy' || self.fiscal_status != 'broke' | |
errors.add :user_not_happy_and_broke, 'User must be happy and broke to continue' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment