unidom-article_number 2.2.2 → 2.2.3

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: 6e22e3e6cfa323b3b8bf336de59e82808f425922
4
- data.tar.gz: 6a8643f23ab3d6ede6f7e6b6e4c8c85766a0bc0f
3
+ metadata.gz: 17922bcfb65355b5a241c94d1f8be0138955bae4
4
+ data.tar.gz: 4ab94d6cc2d4d7a7de60e8df99eda235f41dd6ac
5
5
  SHA512:
6
- metadata.gz: 09c3f186427e2b46dfab8031ab1dc38b7994056d742fc0d83d045ac56335123c8ca56976290bcc32cab9ca0e4aef9f672e95ffe9d9b31b52c6ccdc488f8d9dff
7
- data.tar.gz: e27afbc4b1417bc5b5cb29336ba909f21f359d5f1cabb7181526f91bf83cd7fc488d60e23ccb3070764e26ef08cfc4643bc68137cf44af1336faaf821e750d3e
6
+ metadata.gz: b50467ec96efad5cca52417a71b5122e1147910580ea33fb336b764db0448b6d3a570b5a748299a6cadbccdea2d9bf2140d7fb3a3d84d07bd113e7e582448a28
7
+ data.tar.gz: a1a5970abe0664c246c69cc5a97a763ce05d6422178303f46308dda2c4b3440dcf7ff63916502862d8f4552d55bd0ebcbfa5e185992998a60bb1731d7a9662c6
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Unidom Article Number 物品编码领域模型引擎
2
2
 
3
+ [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/unidom-article_number/frames)
3
4
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
4
5
  [![Gem Version](https://badge.fury.io/rb/unidom-article_number.svg)](https://badge.fury.io/rb/unidom-article_number)
5
6
  [![Dependency Status](https://gemnasium.com/badges/github.com/topbitdu/unidom-accession.svg)](https://gemnasium.com/github.com/topbitdu/unidom-accession)
@@ -63,28 +64,28 @@ include Unidom::ArticleNumber::Concerns::AsEan8Marked
63
64
 
64
65
  ### As Barcode concern
65
66
 
66
- The As Barcode concern do the following tasks for the includer automatically:
67
- 1. Define the has_many :markings macro as: ``has_many :markings, class_name: 'Unidom::ArticleNumber::Marking', as: :barcode``
68
- 2. Define the #mark! method as: ``mark!(marked, by: nil, at: Time.now)``
67
+ The As Barcode concern do the following tasks for the includer automatically:
68
+ 1. Define the has_many :markings macro as: ``has_many :markings, class_name: 'Unidom::ArticleNumber::Marking', as: :barcode``
69
+ 2. Define the #mark! method as: ``mark!(marked, by: nil, at: Time.now)``
69
70
  3. Define the #mark? mathod as: ``mark?(marked, at: Time.now)``
70
71
 
71
72
  ### As Marked concern
72
73
 
73
- The As Marked concern do the following tasks for the includer automatically:
74
- 1. Define the has_many :markings macro as: ``has_many :markings, class_name: 'Unidom::ArticleNumber::Marking', as: :marked``
75
- 2. Define the #is_marked! method as: ``is_marked!(as: nil, by: nil, at: Time.now)``
74
+ The As Marked concern do the following tasks for the includer automatically:
75
+ 1. Define the has_many :markings macro as: ``has_many :markings, class_name: 'Unidom::ArticleNumber::Marking', as: :marked``
76
+ 2. Define the #is_marked! method as: ``is_marked!(as: nil, by: nil, at: Time.now)``
76
77
  3. Define the #is_marked? method as: ``is_marked?(as: nil, at: Time.now)``
77
78
 
78
79
  ### As EAN-13 Marked concern
79
80
 
80
- The As EAN-13 Marked concern do the following tasks for the includer automatically:
81
- 1. Include the As Marked concern
81
+ The As EAN-13 Marked concern do the following tasks for the includer automatically:
82
+ 1. Include the As Marked concern
82
83
  2. Define the has_many :ean13_barcodes macro as: ``has_many :ean13_barcodes, through: :markings, source: :barcode, source_type: 'Unidom::ArticleNumber::Ean13Barcode'``
83
84
 
84
85
  ### As EAN-8 Marked concern
85
86
 
86
- The As EAN-8 Marked concern do the following tasks for the includer automatically:
87
- 1. Include the As Marked concern
87
+ The As EAN-8 Marked concern do the following tasks for the includer automatically:
88
+ 1. Include the As Marked concern
88
89
  2. Define the has_many :ean8_barcodes macro as: ``has_many :ean8_barcodes, through: :markings, source: :barcode, source_type: 'Unidom::ArticleNumber::Ean8Barcode'``
89
90
 
90
91
 
@@ -96,3 +97,19 @@ The As EAN-8 Marked concern do the following tasks for the includer automaticall
96
97
  ```ruby
97
98
  validates :vin, presence: true, 'unidom/article_number/vehicle_identification_number': true
98
99
  ```
100
+
101
+
102
+
103
+ ## Disable the Model & Migration
104
+
105
+ If you only need the app components other than models, the migrations should be neglected, and the models should not be loaded.
106
+ ```ruby
107
+ # config/initializers/unidom.rb
108
+ Unidom::Common.configure do |options|
109
+
110
+ options[:neglected_namespaces] = %w{
111
+ Unidom::ArticleNumber
112
+ }
113
+
114
+ end
115
+ ```
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Application controller 是模块内所有控制器的基类。
3
+
1
4
  class Unidom::ArticleNumber::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::ArticleNumber::ApplicationJob < ActiveJob::Base
2
5
  end
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Application mailer 是模块内所有电子邮件发送类的基类。
3
+
1
4
  class Unidom::ArticleNumber::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::ArticleNumber::ApplicationRecord < ActiveRecord::Base
2
5
  self.abstract_class = true
3
6
  end
@@ -33,4 +33,4 @@ class Unidom::ArticleNumber::Ean13Barcode < Unidom::ArticleNumber::ApplicationRe
33
33
  self.class::RESTRICTED_DISTRIBUTION_GS1_PREFIXES.include? gs1_prefix
34
34
  end
35
35
 
36
- end
36
+ end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::ArticleNumber::Ean13Barcode'
@@ -30,4 +30,4 @@ class Unidom::ArticleNumber::Ean8Barcode < Unidom::ArticleNumber::ApplicationRec
30
30
  self.class::RESTRICTED_DISTRIBUTION_GS1_PREFIXES.include? gs1_prefix
31
31
  end
32
32
 
33
- end
33
+ end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::ArticleNumber::Ean8Barcode'
@@ -33,4 +33,4 @@ class Unidom::ArticleNumber::Marking < Unidom::ArticleNumber::ApplicationRecord
33
33
 
34
34
  end
35
35
 
36
- end
36
+ end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::ArticleNumber::Marking'
@@ -27,4 +27,4 @@ class Unidom::ArticleNumber::VehicleIdentificationNumber < Unidom::ArticleNumber
27
27
  end
28
28
  end
29
29
 
30
- end
30
+ end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::ArticleNumber::VehicleIdentificationNumber'
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module ArticleNumber
3
- VERSION = '2.2.2'.freeze
3
+ VERSION = '2.2.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-article_number
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.3
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-10 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 Article Number domain model engine includes EAN-13, EAN-8, and IMEI models.
29
29
  Unidom (统一领域对象模型)是一系列的领域模型引擎。物品编码领域模型引擎包括EAN-13、EAN-8和IMEI的模型。