Commit 98793756 by ivan Lan

Improve model callback

parent 6ed8272b
...@@ -94,19 +94,20 @@ module Shotengai ...@@ -94,19 +94,20 @@ module Shotengai
end end
def set_pay_time def set_pay_time
self.update!(pay_time: Time.now) self.pay_time = Time.now
end end
def set_delivery_time def set_delivery_time
update!(delivery_time: Time.now) self.delivery_time = Time.now
end end
def set_receipt_time def set_receipt_time
update!(receipt_time: Time.now) self.receipt_time = Time.now
end end
def set_seq def set_seq
self.update!(seq: create_seq) # self.update_without_callbacks!(seq: create_seq)
self.seq = create_seq
end end
def create_seq def create_seq
...@@ -117,7 +118,7 @@ module Shotengai ...@@ -117,7 +118,7 @@ module Shotengai
end end
def set_amount def set_amount
self.update!(amount: (product_amount + delivery_cost).round(2)) self.amount = (product_amount + delivery_cost).round(2)
end end
def amount def amount
......
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