Method: Checkout.manifestations_count

Defined in:
app/models/checkout.rb

.manifestations_count(start_date, end_date, manifestation) ⇒ Object



117
118
119
120
121
122
123
124
125
126
# File 'app/models/checkout.rb', line 117

def self.manifestations_count(start_date, end_date, manifestation)
  self.where(
    self.arel_table[:created_at].gteq start_date
  ).where(
    self.arel_table[:created_at].lt end_date
  )
  .where(
    item_id: manifestation.items.pluck('items.id')
  ).count
end