Commit 12f877a6 by ivan Lan

FIx detail about method name in customer order controller

parent 05f4e9f8
...@@ -38,11 +38,11 @@ module Shotengai ...@@ -38,11 +38,11 @@ module Shotengai
end end
end end
def buy_it_immediately snapshots_params, order_params def buy_it_immediately snapshots_param, order_params
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
order = self.#{collection_name}.create!(order_params) order = self.#{collection_name}.create!(order_params)
snapshots_params && Shotengai::Series.find(snapshots_params[:shotengai_series_id]).snapshots.create!( snapshots_param && Shotengai::Series.find(snapshots_param[:shotengai_series_id]).snapshots.create!(
snapshots_params.merge({ snapshots_param.merge({
shotengai_order: order shotengai_order: order
}) })
) )
......
...@@ -13,13 +13,12 @@ module Shotengai ...@@ -13,13 +13,12 @@ module Shotengai
default_query do |resource, params, request| default_query do |resource, params, request|
end end
index_query do |resource, params, request| index_query do |resource, params, request|
request.params
resource.status_is(params[:status]) resource.status_is(params[:status])
end end
def create # Use :series_id & :count def create # Use :series_id & :count
@resource = @buyer.buy_it_immediately(snapshots_params, resource_params) @resource = @buyer.buy_it_immediately(snapshot_params, resource_params)
respond_with @resource, template: "#{@@template_dir}/show", status: 201 respond_with @resource, template: "#{@@template_dir}/show", status: 201
end end
...@@ -50,8 +49,8 @@ module Shotengai ...@@ -50,8 +49,8 @@ module Shotengai
) )
end end
def snapshots_params def snapshot_params
params[:snapshots] && params.require(:snapshots).permit( params[:snapshot] && params.require(:snapshot).permit(
:shotengai_series_id, :count :shotengai_series_id, :count
) )
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment