Module: SupplejackApi::Concerns::QueryableByDate::ClassMethods

Defined in:
app/models/supplejack_api/concerns/queryable_by_date.rb

Instance Method Summary collapse

Instance Method Details

#created_between(start_date, end_date) ⇒ Object



25
26
27
# File 'app/models/supplejack_api/concerns/queryable_by_date.rb', line 25

def created_between(start_date, end_date)
  where(:date.gte => start_date, :date.lte => end_date)
end

#created_on(date) ⇒ Object



21
22
23
# File 'app/models/supplejack_api/concerns/queryable_by_date.rb', line 21

def created_on(date)
  where(:date.gte => date.at_beginning_of_day, :date.lte => date.at_end_of_day)
end