Module: Ext::Integrations::Event

Included in:
Event
Defined in:
app/models/ext/integrations.rb

Instance Method Summary collapse

Instance Method Details

#shows_with_sales(seller) ⇒ Object



126
127
128
129
130
131
132
133
134
# File 'app/models/ext/integrations.rb', line 126

def shows_with_sales(seller)
  standard =
    ::Order.
      includes(:items => { :show => :event }).
      where("orders.organization_id = ? AND events.id = ?", seller.id, self.id).
      map { |o| o.items.map(&:show) }

  standard.flatten.compact.uniq.sort
end