Commit daa37e9f by ivan Lan

Change the syntax to fit ruby 2.3

parent 870dd2e9
......@@ -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
# }
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment