Skip to content

Instantly share code, notes, and snippets.

@jerodsanto
Created April 22, 2009 14:39
Show Gist options
  • Save jerodsanto/99827 to your computer and use it in GitHub Desktop.
Save jerodsanto/99827 to your computer and use it in GitHub Desktop.
class Pickup < ActiveRecord::Base
validate_on_create :date_three_days_in_future
private
def date_three_days_in_future
errors.add_to_base "must be at least 3 days from now" unless date >= 3.days.from_now.to_date
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment