Skip to content

Instantly share code, notes, and snippets.

@voxxit
Created February 4, 2010 23:52
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 voxxit/295285 to your computer and use it in GitHub Desktop.
Save voxxit/295285 to your computer and use it in GitHub Desktop.
validate_on_create :between_valid_dates?
private
def between_valid_dates?
date1 = dynamically_generate
date2 = dynamically_generate
if !birthdate.between?(date1, date2)
self.errors.add(:birthdate, "is invalid") and return false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment