Skip to content

Instantly share code, notes, and snippets.

@jedschneider
Created April 12, 2010 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jedschneider/363889 to your computer and use it in GitHub Desktop.
Save jedschneider/363889 to your computer and use it in GitHub Desktop.
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