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
3369bc3d
Commit
3369bc3d
authored
Apr 19, 2018
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix editing about spec_rewrite
parent
13bf393f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
product_snapshots_controller.rb
...engai/controller/merchant/product_snapshots_controller.rb
+3
-3
No files found.
lib/shotengai/controller/merchant/product_snapshots_controller.rb
View file @
3369bc3d
...
...
@@ -22,8 +22,8 @@ module Shotengai
def
update
@resource
.
class
.
transaction
do
@resource
.
attributes
=
resource_params
@resource
.
has_changes_to_save?
&&
edit_only_unpaid
@resource
.
update_columns
(
rewrite_params
.
to_h
)
# skip validation
@resource
.
has_changes_to_save?
&&
edit_only_unpaid
&&
@resource
.
save!
@resource
.
update_columns
(
rewrite_params
.
to_h
)
if
rewrite_params
.
present?
# skip validation
end
head
200
end
...
...
@@ -41,7 +41,7 @@ module Shotengai
end
def
edit_only_unpaid
raise
Shotengai
::
WebError
.
new
(
'订单已支付,不可修改该快照。'
,
'-1'
,
403
)
unless
@resource
.
order
.
unpaid?
@resource
.
order
.
unpaid?
||
raise
(
Shotengai
::
WebError
.
new
(
'订单已支付,不可修改该快照。'
,
'-1'
,
403
))
end
def
manager_auth
...
...
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