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
0b76f7be
Commit
0b76f7be
authored
Sep 15, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set default val to meta
parent
12f877a6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
1 deletion
+17
-1
order.rb
lib/shotengai/order.rb
+4
-0
product.rb
lib/shotengai/product.rb
+4
-0
series.rb
lib/shotengai/series.rb
+5
-1
snapshot.rb
lib/shotengai/snapshot.rb
+4
-0
No files found.
lib/shotengai/order.rb
View file @
0b76f7be
...
...
@@ -124,6 +124,10 @@ module Shotengai
end
end
def
meta
super
||
{}
end
class
<<
self
def
inherited
subclass
# define Cart class
...
...
lib/shotengai/product.rb
View file @
0b76f7be
...
...
@@ -63,6 +63,10 @@ module Shotengai
Shotengai
::
Series
.
find_by_id
(
default_series_id
)
||
series
.
first
end
def
meta
super
||
{}
end
class
<<
self
def
series_class
Shotengai
::
Series
...
...
lib/shotengai/series.rb
View file @
0b76f7be
...
...
@@ -30,7 +30,7 @@ module Shotengai
delegate
:title
,
:detail
,
:banners
,
:cover_image
,
:status
,
:status_zh
,
to: :product
# where(
spec->'$.\"颜色\"' = ? and spec->'$.\"大小\"' = ?
,红色,S)
# where(
"spec->'$.\"颜色\"' = ? and spec->'$.\"大小\"' = ?"
,红色,S)
scope
:query_spec_with_product
,
->
(
val
,
product
)
{
if
val
.
keys
.
sort
==
product
.
spec
.
keys
.
sort
keys
=
[];
values
=
[]
...
...
@@ -72,6 +72,10 @@ module Shotengai
read_attribute
(
:original_price
)
||
price
end
def
meta
super
||
{}
end
private
# spec 字段
def
check_spec_value
...
...
lib/shotengai/snapshot.rb
View file @
0b76f7be
...
...
@@ -120,6 +120,10 @@ module Shotengai
######
def
meta
super
||
{}
end
private
# spec 字段
def
check_spec
...
...
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