Commit 12f877a6 by ivan Lan

FIx detail about method name in customer order controller

parent 05f4e9f8
......@@ -38,11 +38,11 @@ module Shotengai
end
end
def buy_it_immediately snapshots_params, order_params
def buy_it_immediately snapshots_param, order_params
ActiveRecord::Base.transaction do
order = self.#{collection_name}.create!(order_params)
snapshots_params && Shotengai::Series.find(snapshots_params[:shotengai_series_id]).snapshots.create!(
snapshots_params.merge({
snapshots_param && Shotengai::Series.find(snapshots_param[:shotengai_series_id]).snapshots.create!(
snapshots_param.merge({
shotengai_order: order
})
)
......
......@@ -14,12 +14,11 @@ module Shotengai
end
index_query do |resource, params, request|
request.params
resource.status_is(params[:status])
end
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
end
......@@ -50,8 +49,8 @@ module Shotengai
)
end
def snapshots_params
params[:snapshots] && params.require(:snapshots).permit(
def snapshot_params
params[:snapshot] && params.require(:snapshot).permit(
:shotengai_series_id, :count
)
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