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
31df0e3c
Commit
31df0e3c
authored
Apr 25, 2018
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip snapshot remark_value if the key does not given
parent
927a05f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
product_snapshots_controller.rb
...engai/controller/merchant/product_snapshots_controller.rb
+4
-2
No files found.
lib/shotengai/controller/merchant/product_snapshots_controller.rb
View file @
31df0e3c
...
@@ -30,10 +30,12 @@ module Shotengai
...
@@ -30,10 +30,12 @@ module Shotengai
private
private
def
resource_params
def
resource_params
remark_value
=
params
.
require
(
resource_key
).
fetch
(
:remark_value
,
{})
.
permit!
remark_value
=
params
.
require
(
resource_key
).
fetch
(
:remark_value
,
nil
)
&
.
permit!
params
.
require
(
resource_key
).
permit
(
params
.
require
(
resource_key
).
permit
(
:revised_amount
:revised_amount
).
merge
(
remark_value:
remark_value
)
# WARNING: if .fetch(:remark_value, {}) get value {}
# it would update to this value
).
merge
(
remark_value:
remark_value
||
@resource
.
remark_value
)
end
end
def
rewrite_params
def
rewrite_params
...
...
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