Class: Spree::Admin::Calendars::OrdersController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/admin/calendars/orders_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#active_date, #default_url_options, #load_active_date, #redirect_to_current_date

Instance Method Details

#collectionObject



5
6
7
8
9
10
11
12
13
# File 'app/controllers/spree/admin/calendars/orders_controller.rb', line 5

def collection
  # for whole month calendar
  from = active_date.beginning_of_month - 1.week
  to = active_date.end_of_month + 1.week

  @collection ||= Spree::Order.where.not(state: :cart)
                              .joins(:line_items)
                              .where(line_items: { from_date: from..to, vendor_id: params[:vendor_id] })
end

#model_classObject



16
17
18
# File 'app/controllers/spree/admin/calendars/orders_controller.rb', line 16

def model_class
  Spree::Order
end

#object_nameObject



21
22
23
# File 'app/controllers/spree/admin/calendars/orders_controller.rb', line 21

def object_name
  'order'
end