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
daa37e9f
Commit
daa37e9f
authored
Sep 01, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the syntax to fit ruby 2.3
parent
870dd2e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
11 deletions
+22
-11
order.rb
lib/shotengai/order.rb
+11
-8
product.rb
lib/shotengai/product.rb
+11
-3
No files found.
lib/shotengai/order.rb
View file @
daa37e9f
...
...
@@ -40,18 +40,21 @@ module Shotengai
state
:unpaid
,
initial:
true
state
:paid
,
:delivering
,
:received
,
:canceled
,
:evaluated
event
:pay
,
before:
[
:fill_snapshot
,
:set_pay_time
]
{
event
:pay
,
before:
[
:fill_snapshot
,
:set_pay_time
]
do
transitions
from: :unpaid
,
to: :paid
}
event
:cancel
{
end
event
:cancel
do
transitions
from: :unpaid
,
to: :canceled
}
event
:send_out
,
after: :set_delivery_time
{
end
event
:send_out
,
after: :set_delivery_time
do
transitions
from: :paid
,
to: :delivering
}
event
:get_it
,
after: :set_receipt_time
{
end
event
:get_it
,
after: :set_receipt_time
do
transitions
from: :delivering
,
to: :received
}
end
# event :evaluate {
# transitions from: :received, to: :evaluated
# }
...
...
lib/shotengai/product.rb
View file @
daa37e9f
...
...
@@ -38,9 +38,17 @@ module Shotengai
state
:no_on
,
initial:
true
state
:on_sale
,
:deleted
event
:put_on_shelf
{
transitions
from: :no_on
,
to: :on_sale
}
event
:sold_out
{
transitions
from: :on_sale
,
to: :no_on
}
event
:soft_delete
{
transitions
from:
[
:on_sale
,
:no_on
],
to: :deleted
}
event
:put_on_shelf
do
transitions
from: :no_on
,
to: :on_sale
end
event
:sold_out
do
transitions
from: :on_sale
,
to: :no_on
end
event
:soft_delete
do
transitions
from:
[
:on_sale
,
:no_on
],
to: :deleted
end
end
def
status_zh
...
...
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