Skip to content

Instantly share code, notes, and snippets.

@amrnt
Created March 10, 2010 22:42
Show Gist options
  • Save amrnt/328547 to your computer and use it in GitHub Desktop.
Save amrnt/328547 to your computer and use it in GitHub Desktop.
class Period < ActiveRecord::Base
belongs_to :show
def show_date
start_at.nil? ? Time.now.to_date : start_at.to_date
end
def start_at_time
start_at.nil? ? Time.now.to_time : start_at.to_time
end
def end_at_time
end_at.nil? ? Time.now.to_time : end_at.to_time
end
def start_at_time=(start_str)
self.start_at = BLAAALALALAL
end
def end_at_time=(end_str)
self.end_at = BLAAALALALAL
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment