Module: SearchByDates
- Included in:
- MembershipSaleSearch, PassSaleSearch, SaleSearch
- Defined in:
- app/concerns/search_by_dates.rb
Instance Attribute Summary collapse
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
-
#stop ⇒ Object
readonly
Returns the value of attribute stop.
Instance Method Summary collapse
- #default_start ⇒ Object
- #default_stop ⇒ Object
- #start_with(start) ⇒ Object
- #stop_with(stop) ⇒ Object
Instance Attribute Details
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
3 4 5 |
# File 'app/concerns/search_by_dates.rb', line 3 def organization @organization end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
2 3 4 |
# File 'app/concerns/search_by_dates.rb', line 2 def start @start end |
#stop ⇒ Object (readonly)
Returns the value of attribute stop.
2 3 4 |
# File 'app/concerns/search_by_dates.rb', line 2 def stop @stop end |
Instance Method Details
#default_start ⇒ Object
13 14 15 |
# File 'app/concerns/search_by_dates.rb', line 13 def default_start DateTime.now.in_time_zone(@organization.time_zone).beginning_of_month end |
#default_stop ⇒ Object
17 18 19 |
# File 'app/concerns/search_by_dates.rb', line 17 def default_stop DateTime.now.in_time_zone(@organization.time_zone).end_of_day end |
#start_with(start) ⇒ Object
5 6 7 |
# File 'app/concerns/search_by_dates.rb', line 5 def start_with(start) start.present? ? DateTime.parse(start) : default_start end |
#stop_with(stop) ⇒ Object
9 10 11 |
# File 'app/concerns/search_by_dates.rb', line 9 def stop_with(stop) stop.present? ? Sundial.midnightish(@organization, stop) : default_stop end |