Module: ActsAsHistorical::DynamicClassMethods
- Defined in:
- lib/acts_as_historical.rb
Instance Method Summary collapse
Instance Method Details
#historical_date_col_sql ⇒ Object
125 126 127 |
# File 'lib/acts_as_historical.rb', line 125 def historical_date_col_sql "`#{self.table_name}`.`#{self.historical_date_col}`" end |
#tolerance_to_range(date, range) ⇒ Object
129 130 131 132 133 134 135 136 137 |
# File 'lib/acts_as_historical.rb', line 129 def tolerance_to_range(date,range) if range.is_a?(Numeric) range = (date - range)..(date + range) elsif range.respond_to?(:to_date_range) range = range.to_date_range elsif range.is_a?(Range) range end end |