Skip to content

Instantly share code, notes, and snippets.

@Szeliga
Created August 30, 2012 19:11
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 Szeliga/3538029 to your computer and use it in GitHub Desktop.
Save Szeliga/3538029 to your computer and use it in GitHub Desktop.
before_validation :set_default_time
def set_default_time
self.start_date ||= Time.now.beginning_of_day
self.end_date ||= Time.now.end_of_day
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment