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
04c3d4e2
Commit
04c3d4e2
authored
Aug 24, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add merchant_remark, customer_remark and mark to order
parent
9b70d4da
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
35 deletions
+43
-35
1_create_shotengai_products_and_orders.rb
db/migrate/1_create_shotengai_products_and_orders.rb
+3
-1
controllers_generator.rb
lib/generators/shotengai/controllers_generator.rb
+3
-3
order.rb
lib/shotengai/order.rb
+19
-15
shotengai_orders.rb
spec/factories/shotengai_orders.rb
+18
-16
No files found.
db/migrate/1_create_shotengai_products_and_orders.rb
View file @
04c3d4e2
...
...
@@ -39,7 +39,9 @@ class CreateShotengaiProductsAndOrders < ActiveRecord::Migration[5.1]
t
.
datetime
:receipt_time
t
.
string
:delivery_way
t
.
string
:delivery_cost
t
.
text
:merchant_remark
t
.
string
:mark
# merchant mark, like red, blue ..
t
.
text
:customer_remark
t
.
string
:status
t
.
string
:type
t
.
json
:meta
...
...
lib/generators/shotengai/controllers_generator.rb
View file @
04c3d4e2
...
...
@@ -38,9 +38,9 @@ module Shotengai
raise
'Illegal role. Only merchant or customer'
unless
role
.
in?
([
'merchant'
,
'customer'
])
@controller_prefix
=
options
[
:namespace
].
blank?
?
''
:
(
options
[
:namespace
].
camelize
+
'::'
)
{
'products'
=>
options
[
:product
],
z
# orders: order
,
# series: "#{Product
}Series"
'products'
=>
options
[
:product
],
'orders'
=>
options
[
:order
]
,
'product_series'
=>
"
#{
options
[
:product
]
}
Series"
}.
each
do
|
key
,
klass_name
|
@key
,
@klass_name
=
key
,
klass_name
template
"
#{
role
}
/
#{
@key
}
_controller.rb"
,
...
...
lib/shotengai/order.rb
View file @
04c3d4e2
...
...
@@ -3,21 +3,24 @@ module Shotengai
#
# Table name: shotengai_orders
#
# id :integer not null, primary key
# seq :integer
# address :string(255)
# pay_time :datetime
# delivery_time :datetime
# receipt_time :datetime
# delivery_way :string(255)
# delivery_cost :string(255)
# status :string(255)
# type :string(255)
# meta :json
# buyer_id :integer
# buyer_type :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# id :integer not null, primary key
# seq :integer
# address :string(255)
# pay_time :datetime
# delivery_time :datetime
# receipt_time :datetime
# delivery_way :string(255)
# delivery_cost :string(255)
# merchant_remark :text(65535)
# mark :string(255)
# customer_remark :text(65535)
# status :string(255)
# type :string(255)
# meta :json
# buyer_id :integer
# buyer_type :string(255)
# created_at :datetime not null
# updated_at :datetime not null
class
Order
<
ActiveRecord
::
Base
self
.
table_name
=
'shotengai_orders'
...
...
@@ -38,6 +41,7 @@ module Shotengai
}.
each
{
|
name
,
options
|
event
(
name
)
{
transitions
options
}
}
end
def
fill_snapshot
...
...
spec/factories/shotengai_orders.rb
View file @
04c3d4e2
...
...
@@ -2,23 +2,25 @@
#
# Table name: shotengai_orders
#
# id :integer not null, primary key
# seq :integer
# address :string(255)
# pay_time :datetime
# delivery_time :datetime
# receipt_time :datetime
# delivery_way :string(255)
# delivery_cost :string(255)
# status :string(255)
# type :string(255)
# meta :json
# buyer_id :integer
# buyer_type :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# id :integer not null, primary key
# seq :integer
# address :string(255)
# pay_time :datetime
# delivery_time :datetime
# receipt_time :datetime
# delivery_way :string(255)
# delivery_cost :string(255)
# merchant_remark :text(65535)
# mark :string(255)
# customer_remark :text(65535)
# status :string(255)
# type :string(255)
# meta :json
# buyer_id :integer
# buyer_type :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
FactoryGirl
.
define
do
factory
:shotengai_order
do
...
...
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