Module: DateScope::Extension
- Defined in:
- lib/datescope/extension.rb
Instance Method Summary collapse
- #last_month ⇒ Object
- #month_before_last_month ⇒ Object
- #this_month ⇒ Object
- #this_week ⇒ Object
- #this_year ⇒ Object
- #today ⇒ Object
Instance Method Details
#last_month ⇒ Object
16 17 18 |
# File 'lib/datescope/extension.rb', line 16 def last_month where("created_at >= ? and created_at <= ?", Intervals.last_month[:start], Intervals.last_month[:end]) end |
#month_before_last_month ⇒ Object
20 21 22 |
# File 'lib/datescope/extension.rb', line 20 def month_before_last_month where("created_at >= ? and created_at <= ?", Intervals.month_before_last_month[:start], Intervals.month_before_last_month[:end]) end |
#this_month ⇒ Object
12 13 14 |
# File 'lib/datescope/extension.rb', line 12 def this_month where("created_at >= ?", Intervals.this_month[:start]) end |
#this_week ⇒ Object
8 9 10 |
# File 'lib/datescope/extension.rb', line 8 def this_week where("created_at >= ?", Intervals.this_week[:start]) end |