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
98793756
Commit
98793756
authored
Oct 07, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve model callback
parent
6ed8272b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
order.rb
lib/shotengai/order.rb
+6
-5
No files found.
lib/shotengai/order.rb
View file @
98793756
...
@@ -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
...
...
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