unidom-shipment 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 746789335080b96c3181f4f11eb7209b427acff3
4
- data.tar.gz: 7d85f4bf63a9046388ab5367700c4ae517e45909
3
+ metadata.gz: 347ea304d226d488dc4c245530ac07ba4a552b24
4
+ data.tar.gz: 5378250e4a5421f432256e975e822ef50717c235
5
5
  SHA512:
6
- metadata.gz: 614d16008090811e01fa17c6d3ee8282ec171ef8f7357e3b40acc6daf5134b892cbb4d76c3d2f38921a41579a0705bbff7f5e1d3da37b076a677a68f2cb801c5
7
- data.tar.gz: 6298d96131b1f0215a20231e76c873d0dec6b089f7c853310e00cabec18674fcff7135b75375a564d71a2bbb7ad257d02abd8f548d562e5bcc81de561cf31fdc
6
+ metadata.gz: 3e6b1346f8e53ccab60df0d2ba0da26ffd2cb0ddd1c7df0ad49a7a933e74fc96e7e49c3e555c380abd8e78c920c0f93f86bf855cd5fe12e79a4a919a65f012fc
7
+ data.tar.gz: 6d90d77d0fb276e997f230282f4769993cf7002ab60f06584f17aaee18a28007aa6b3756736669f11ae3c57641416d322f086dfc7c3f1aff0769ad1595d0bc77
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Unidom Shipment 装运领域模型引擎
2
2
 
3
+ [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/unidom-shipment/frames)
3
4
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
5
+
4
6
  [![Gem Version](https://badge.fury.io/rb/unidom-shipment.svg)](https://badge.fury.io/rb/unidom-shipment)
5
7
  [![Dependency Status](https://gemnasium.com/badges/github.com/topbitdu/unidom-shipment.svg)](https://gemnasium.com/github.com/topbitdu/unidom-shipment)
6
8
 
@@ -56,8 +58,8 @@ include Unidom::Shipment::Concerns::AsShipped
56
58
 
57
59
  ### As Shipped
58
60
 
59
- The As Shipped concern do the following tasks for the includer automatically:
60
- 1. Define the has_many :shipment_items macro as: ``has_many :shipment_items, class_name: 'Unidom::Shipment::ShipmentItem', foreign_key: :shipped_id``
61
+ The As Shipped concern do the following tasks for the includer automatically:
62
+ 1. Define the has_many :shipment_items macro as: ``has_many :shipment_items, class_name: 'Unidom::Shipment::ShipmentItem', foreign_key: :shipped_id``
61
63
  2. Define the has_many :shipment_receipts macro as: ``has_many :shipment_receipts, class_name: 'Unidom::Shipment::ShipmentReceipt', foreign_key: :shipped_id``
62
64
 
63
65
 
@@ -74,3 +76,19 @@ Unidom::Shipment::Conveyance::purchase_return # 进货退回
74
76
  Unidom::Shipment::Conveyance::transfer # 转运
75
77
  Unidom::Shipment::Conveyance::drop_shipment # 直接装运
76
78
  ```
79
+
80
+
81
+
82
+ ## Disable the Model & Migration
83
+
84
+ If you only need the app components other than models, the migrations should be neglected, and the models should not be loaded.
85
+ ```ruby
86
+ # config/initializers/unidom.rb
87
+ Unidom::Common.configure do |options|
88
+
89
+ options[:neglected_namespaces] = %w{
90
+ Unidom::Shipment
91
+ }
92
+
93
+ end
94
+ ```
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Application controller 是模块内所有控制器的基类。
3
+
1
4
  class Unidom::Shipment::ApplicationController < ActionController::Base
2
5
  protect_from_forgery with: :exception
3
6
  end
@@ -1,2 +1,5 @@
1
+ ##
2
+ # Application job 是模块内所有异步任务的基类。
3
+
1
4
  class Unidom::Shipment::ApplicationJob < ActiveJob::Base
2
5
  end
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Application mailer 是模块内所有电子邮件发送类的基类。
3
+
1
4
  class Unidom::Shipment::ApplicationMailer < ActionMailer::Base
2
5
  default from: 'from@example.com'
3
6
  layout 'mailer'
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Application record 是模块内所有模型的抽象基类。
3
+
1
4
  class Unidom::Shipment::ApplicationRecord < ActiveRecord::Base
2
5
  self.abstract_class = true
3
6
  end
@@ -1,12 +1,5 @@
1
1
  ##
2
2
  # Shipment 是装运。
3
- # conveyance_code 是运送代码,可以是以下取值:
4
- # CSSP: Customer Shipment 客户装运,把货物发给客户。
5
- # CSRT: Customer Return 客户退回,从购买了产品的客户那里把退回的产品运回来。
6
- # PCSP: Purchase Shipment 购买装运,从供应商那里把购买的货物运进来。
7
- # PCRT: Purchase Return 进货退回,把发来的货物返回给供应商。
8
- # TRSF: Transfer 转运,从内部组织到另一个内部组织调拨。
9
- # DROP: Drop Shipment 直接装运,销售商把产品从供应商那里直接运送给客户。
10
3
 
11
4
  class Unidom::Shipment::Shipment < Unidom::Shipment::ApplicationRecord
12
5
 
@@ -32,4 +25,4 @@ class Unidom::Shipment::Shipment < Unidom::Shipment::ApplicationRecord
32
25
 
33
26
  code :conveyance, Unidom::Shipment::Conveyance
34
27
 
35
- end
28
+ end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Shipment::Shipment'
@@ -14,4 +14,4 @@ class Unidom::Shipment::ShipmentItem < Unidom::Shipment::ApplicationRecord
14
14
 
15
15
  has_many :package_items, class_name: 'Unidom::Shipment::ShipmentPackageItem'
16
16
 
17
- end
17
+ end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Shipment::ShipmentItem'
@@ -16,4 +16,4 @@ class Unidom::Shipment::ShipmentPackage < Unidom::Shipment::ApplicationRecord
16
16
 
17
17
  scope :serial_number_is, ->(serial_number) { where serial_number: serial_number }
18
18
 
19
- end
19
+ end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Shipment::ShipmentPackage'
@@ -12,4 +12,4 @@ class Unidom::Shipment::ShipmentPackageItem < Unidom::Shipment::ApplicationRecor
12
12
  belongs_to :package, class_name: 'Unidom::Shipment::ShipmentPackage'
13
13
  belongs_to :shipment_item, class_name: 'Unidom::Shipment::ShipmentItem'
14
14
 
15
- end
15
+ end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Shipment::ShipmentPackageItem'
@@ -21,4 +21,4 @@ class Unidom::Shipment::ShipmentReceipt < Unidom::Shipment::ApplicationRecord
21
21
  self.received_at = Time.now if received_at.blank?
22
22
  end
23
23
 
24
- end
24
+ end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Shipment::ShipmentReceipt'
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Conveyance 是枚举型的运送代码。
3
+
1
4
  class Unidom::Shipment::Conveyance < ActiveRecord::Type::Value
2
5
 
3
6
  include ProgneTapera::EnumConfig
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Shipment
3
- VERSION = '0.6.1'.freeze
3
+ VERSION = '0.6.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-shipment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-03 00:00:00.000000000 Z
11
+ date: 2017-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.8'
19
+ version: '1.9'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.8'
26
+ version: '1.9'
27
27
  description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.
28
28
  The Shipment domain model engine includes the Shipment and the Shipment Item. Unidom
29
29
  (统一领域对象模型)是一系列的领域模型引擎。装运领域模型引擎包括装运和装运项的模型。