5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'app/controllers/spree/admin/shipments_controller.rb', line 5
def index
params[:q] ||= {}
created_at_gt = params[:q][:created_at_gt]
created_at_lt = params[:q][:created_at_lt]
if !params[:q][:created_at_gt].blank?
params[:q][:created_at_gt] = Time.zone.parse(params[:q][:created_at_gt]).beginning_of_day rescue ""
end
if !params[:q][:created_at_lt].blank?
params[:q][:created_at_lt] = Time.zone.parse(params[:q][:created_at_lt]).end_of_day rescue ""
end
@search = Spree::Shipment.accessible_by(current_ability, :index).ransack(params[:q])
@shipments = @search.result.
page(params[:page]).
per(params[:per_page] || Spree::Config[:orders_per_page])
params[:q][:created_at_gt] = created_at_gt
params[:q][:created_at_lt] = created_at_lt
end
|