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
993760e8
Commit
993760e8
authored
Sep 13, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve order spec
parent
6f9ca3f0
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
2 deletions
+15
-2
order_spec.rb
...generators/templates/spec/requests/customer/order_spec.rb
+8
-0
_merchant_order.json.jbuilder
...ators/templates/views/share/_merchant_order.json.jbuilder
+1
-0
_merchant_order_simple.json.jbuilder
...emplates/views/share/_merchant_order_simple.json.jbuilder
+1
-0
_order.json.jbuilder
lib/generators/templates/views/share/_order.json.jbuilder
+2
-1
_order_simple.json.jbuilder
...erators/templates/views/share/_order_simple.json.jbuilder
+2
-0
buyer.rb
lib/shotengai/buyer.rb
+1
-1
No files found.
lib/generators/templates/spec/requests/customer/order_spec.rb
View file @
993760e8
...
...
@@ -206,6 +206,10 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta
type: :object
,
properties:
{
address:
{
type: :string
},
user_remark:
{
type: :text
},
address:
{
type: :string
},
delivery_way:
{
type: :string
},
delivery_cost:
{
type: :string
},
meta:
{
type: :object
},
incr_snapshot_ids:
{
type: :array
},
},
snapshots:
{
...
...
@@ -281,6 +285,10 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta
type: :object
,
properties:
{
address:
{
type: :string
},
user_remark:
{
type: :text
},
address:
{
type: :string
},
delivery_way:
{
type: :string
},
delivery_cost:
{
type: :string
},
meta:
{
type: :object
},
incr_snapshot_ids:
{
type: :array
},
gone_snapshot_ids:
{
type: :array
},
}
...
...
lib/generators/templates/views/share/_merchant_order.json.jbuilder
View file @
993760e8
json.extract! order, :id, :seq, :address,
:total_price, :total_original_price,
:pay_time, :delivery_time, :receipt_time,
:delivery_way, :delivery_cost,
:merchant_remark, :mark, :customer_remark,
...
...
lib/generators/templates/views/share/_merchant_order_simple.json.jbuilder
View file @
993760e8
json.extract! order, :id, :seq, :address,
:total_price, :total_original_price,
:pay_time, :delivery_time, :receipt_time,
:delivery_way, :delivery_cost,
:merchant_remark, :mark, :customer_remark,
...
...
lib/generators/templates/views/share/_order.json.jbuilder
View file @
993760e8
json.extract! order, :id, :seq, :status_zh, :address,
json.extract! order, :id, :seq, :total_price, :total_original_price,
:status_zh, :address,
:pay_time, :delivery_time, :receipt_time,
:delivery_way, :delivery_cost, :customer_remark,
:status, :status_zh, :meta
...
...
lib/generators/templates/views/share/_order_simple.json.jbuilder
View file @
993760e8
json.extract! order, :id, :seq, :address,
:total_price, :total_original_price,
:pay_time, :delivery_time, :receipt_time,
:delivery_way, :delivery_cost, :customer_remark,
:status, :status_zh, :meta
\ No newline at end of file
lib/shotengai/buyer.rb
View file @
993760e8
...
...
@@ -14,7 +14,7 @@ module Shotengai
collection_name
=
klass
.
model_name
.
collection
||
options
[
:as
]
cart_name
=
"
#{
klass
.
model_name
.
singular
}
_cart"
# has many Order
has_many
collection_name
.
to_sym
,
class_name:
klass
.
name
,
as: :buyer
has_many
collection_name
.
to_sym
,
class_name:
klass
_
name
,
as: :buyer
# has one Cart
has_one
cart_name
.
to_sym
,
class_name:
klass
.
cart_class
.
name
,
as: :buyer
# User.new Cart 相关
...
...
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