Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shotengai
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
shotengai
Commits
12f877a6
Commit
12f877a6
authored
Sep 15, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FIx detail about method name in customer order controller
parent
05f4e9f8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
buyer.rb
lib/shotengai/buyer.rb
+3
-3
orders_controller.rb
lib/shotengai/controllers/customer/orders_controller.rb
+3
-4
No files found.
lib/shotengai/buyer.rb
View file @
12f877a6
...
...
@@ -38,11 +38,11 @@ module Shotengai
end
end
def buy_it_immediately snapshots_param
s
, order_params
def buy_it_immediately snapshots_param, order_params
ActiveRecord::Base.transaction do
order = self.
#{
collection_name
}
.create!(order_params)
snapshots_param
s && Shotengai::Series.find(snapshots_params
[:shotengai_series_id]).snapshots.create!(
snapshots_param
s
.merge({
snapshots_param
&& Shotengai::Series.find(snapshots_param
[:shotengai_series_id]).snapshots.create!(
snapshots_param.merge({
shotengai_order: order
})
)
...
...
lib/shotengai/controllers/customer/orders_controller.rb
View file @
12f877a6
...
...
@@ -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
(
snapshot
s
_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
snapshot
s
_params
params
[
:snapshot
s
]
&&
params
.
require
(
:snapshots
).
permit
(
def
snapshot_params
params
[
:snapshot
]
&&
params
.
require
(
:snapshot
).
permit
(
:shotengai_series_id
,
:count
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment