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
e002fccf
Commit
e002fccf
authored
Aug 28, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix status_zh
parent
feac21d8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
5 deletions
+7
-5
order.rb
lib/shotengai/order.rb
+1
-1
product.rb
lib/shotengai/product.rb
+2
-2
series.rb
lib/shotengai/series.rb
+1
-1
snapshot.rb
lib/shotengai/snapshot.rb
+3
-1
No files found.
lib/shotengai/order.rb
View file @
e002fccf
...
...
@@ -56,7 +56,7 @@ module Shotengai
delivering:
'运送中'
,
received:
'已收货'
,
evaluated:
'已评价'
,
}[
status
]
}[
status
.
to_sym
]
end
def
fill_snapshot
...
...
lib/shotengai/product.rb
View file @
e002fccf
...
...
@@ -40,10 +40,10 @@ module Shotengai
def
status_zh
{
on
_on:
'未上架'
,
no
_on:
'未上架'
,
on_sale:
'已上架'
,
deleted:
'已删除'
}[
status
]
}[
status
.
to_sym
]
end
def
default_series
...
...
lib/shotengai/series.rb
View file @
e002fccf
...
...
@@ -27,7 +27,7 @@ module Shotengai
# Using validates_uniqueness_of do not work if the order of Hash is diff
validate
:uniq_spec
delegate
:title
,
:detail
,
:banners
,
:cover_image
,
:status
,
to: :product
delegate
:title
,
:detail
,
:banners
,
:cover_image
,
:status
_zh
,
to: :product
scope
:query_spec_with_product
,
->
(
val
,
product
)
{
return
none
unless
val
.
keys
.
sort
==
product
.
spec
.
keys
.
sort
...
...
lib/shotengai/snapshot.rb
View file @
e002fccf
...
...
@@ -31,6 +31,8 @@ module Shotengai
validate
:check_spec
,
if: :spec
validates
:count
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
belongs_to
:shotengai_order
,
optional:
true
class
<<
self
def
inherited
subclass
product_name
=
/^(.+)Snapshot/
.
match
(
subclass
.
name
)[
1
]
...
...
@@ -79,7 +81,7 @@ module Shotengai
end
def
order_status_zh
order
&
.
status_zh
shotengai_
order
&
.
status_zh
end
######
...
...
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