Module: Daterange
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/acts_as_daterange/daterange.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #active_now? ⇒ Boolean
- #expire ⇒ Object
- #expire! ⇒ Object
- #expire_column ⇒ Object
- #start_column ⇒ Object
Instance Method Details
#active_now? ⇒ Boolean
55 56 57 |
# File 'lib/acts_as_daterange/daterange.rb', line 55 def active_now? started? and not ended? end |
#expire ⇒ Object
45 46 47 48 |
# File 'lib/acts_as_daterange/daterange.rb', line 45 def expire write_attribute(start_column, nil) write_attribute(expire_column, Time.now) end |
#expire! ⇒ Object
50 51 52 53 |
# File 'lib/acts_as_daterange/daterange.rb', line 50 def expire! update_attribute(start_column, nil) update_attribute(expire_column, Time.now) end |
#expire_column ⇒ Object
37 38 39 |
# File 'lib/acts_as_daterange/daterange.rb', line 37 def expire_column self.class.expire_column end |
#start_column ⇒ Object
41 42 43 |
# File 'lib/acts_as_daterange/daterange.rb', line 41 def start_column self.class.start_column end |