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
d30a6c48
Commit
d30a6c48
authored
Oct 26, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the :only_one_series validation in series
parent
4505001d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
series.rb
lib/shotengai/series.rb
+2
-2
No files found.
lib/shotengai/series.rb
View file @
d30a6c48
...
...
@@ -36,7 +36,7 @@ module Shotengai
# validate remark
validate
:check_remark_value
,
unless: :remark_template_empty?
[{
"key"
=>
"其他"
,
"val"
=>
"true"
}]
harray_accessor
:info_template
,
:detail_info_template
harray_accessor
:spec_value
,
:remark_value
,
decode:
true
...
...
@@ -139,7 +139,7 @@ module Shotengai
end
def
only_one_series
errors
.
add
(
:spec_value
,
"无规格系列仅允许存在一项"
)
unless
product
.
series
.
empty?
errors
.
add
(
:spec_value
,
"无规格系列仅允许存在一项"
)
unless
(
product
.
series
-
[
self
])
.
empty?
end
def
check_remark_value
...
...
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