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
927a05f4
Commit
927a05f4
authored
Apr 20, 2018
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Decode series spec_value to hash if snapshot delegate spec_value to it
parent
573e9d08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
snapshot.rb
lib/shotengai/snapshot.rb
+10
-2
No files found.
lib/shotengai/snapshot.rb
View file @
927a05f4
...
...
@@ -86,11 +86,15 @@ module Shotengai
%i{
title cover_image banners detail
original_price price
spec_value
}
.
each
do
|
column
|
define_method
(
column
)
{
super
()
||
shotengai_series
.
send
(
column
)
}
end
def
spec_value
# Hash
super
()
||
shotengai_series
.
spec_value
.
decode
end
# 重写 JsonColumn 中 column_has_implants 所生成的 detail_info_value 方法,
# 将未支付时的 detail_info_value 指派给 series.detail_info_template
# 'detail' 为 上方 column_has_implants 所指定的对应嵌入物(implants)
...
...
@@ -114,6 +118,10 @@ module Shotengai
super
||
{}
end
def
remark_value
super
||
{}
end
def
product
shotengai_series
.
product
end
...
...
@@ -167,7 +175,7 @@ module Shotengai
end
def
remark_template_empty?
remark_template
.
empty?
&&
remark_value
.
nil
?
# 当且仅当二者都为空才跳过验证
remark_template
.
empty?
&&
remark_value
.
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