unidom-article_number 1.2.1 → 1.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: 51be47dc45e40c3efadec8ed1a553e86648baf7c
4
- data.tar.gz: 2bfb4c08acdc460260eb44f55c93be83f81006f5
3
+ metadata.gz: 7713f349391cad8f08ee311e87b7e21fd6cb6778
4
+ data.tar.gz: f089924d0e6865d3a2613fe2d717ab99359e885d
5
5
  SHA512:
6
- metadata.gz: 563b5153fcd93d9d49e3570e0c8eecb84f52d9d064c69571c03efc477d787bc44b84e78d338b7739a159b757f472613db345c391f1a8b6f492cc6a74dc0acb8b
7
- data.tar.gz: aa3649219ebdb2c33df5ae62990d0c6eefa01b1ee653afdb8bd6f02310a0b493105bacf0a973780d11e6080c405c6edc0c53428c2ec4bc1dac6b597294e633fb
6
+ metadata.gz: eef21de0f53df79eac176265016f7f7d9e99fc9307974144bcb03b12772bc899d6029306ac717624d7320a0f4d2cf84865fd99b55d689e5b12acb542d5fadf0f
7
+ data.tar.gz: c926e8bbe8559b96baac2b243807314253f92edeb5acf9b0e765cb9c2c0c3f79d426ab900f185e1f146d7e56c25460cee63f8ac4a873565bbff3023b3912d4e8
data/README.md CHANGED
@@ -37,6 +37,8 @@ ean_8_marking = Unidom::ArticleNumber::Marking.barcode_is(ean_8_barcode).marked_
37
37
  ```ruby
38
38
  include Unidom::ArticleNumber::Concerns::AsBarcode
39
39
  include Unidom::ArticleNumber::Concerns::AsMarked
40
+ include Unidom::ArticleNumber::Concerns::AsEan13Marked
41
+ include Unidom::ArticleNumber::Concerns::AsEan8Marked
40
42
  ```
41
43
 
42
44
  ### As Barcode concern
@@ -49,3 +51,13 @@ The As Barcode concern do the following tasks for the includer automatically:
49
51
  The As Marked concern do the following tasks for the includer automatically:
50
52
  1. Define the has_many :markings macro as: ``has_many :markings, class_name: 'Unidom::ArticleNumber::Marking', as: :marked``
51
53
  2. Define the #is_marked! method as: ``def is_marked!(as: nil, by: nil, at: Time.now)``
54
+
55
+ ### As EAN-13 Marked concern
56
+ The As EAN-13 Marked concern do the following tasks for the includer automatically:
57
+ 1. Include the As Marked concern
58
+ 2. Define the has_many :ean13_barcodes macro as: ``has_many :ean13_barcodes, through: :markings, source: :barcode, source_type: 'Unidom::ArticleNumber::Ean13Barcode'``
59
+
60
+ ### As EAN-8 Marked concern
61
+ The As EAN-8 Marked concern do the following tasks for the includer automatically:
62
+ 1. Include the As Marked concern
63
+ 2. Define the has_many :ean8_barcodes macro as: ``has_many :ean8_barcodes, through: :markings, source: :barcode, source_type: 'Unidom::ArticleNumber::Ean8Barcode'``
@@ -0,0 +1,13 @@
1
+ module Unidom::ArticleNumber::Concerns::AsEan13Marked
2
+
3
+ extend ActiveSupport::Concern
4
+
5
+ include Unidom::ArticleNumber::Concerns::AsMarked
6
+
7
+ included do |includer|
8
+
9
+ has_many :ean13_barcodes, through: :markings, source: :barcode, source_type: 'Unidom::ArticleNumber::Ean13Barcode'
10
+
11
+ end
12
+
13
+ end
@@ -0,0 +1,13 @@
1
+ module Unidom::ArticleNumber::Concerns::AsEan8Marked
2
+
3
+ extend ActiveSupport::Concern
4
+
5
+ include Unidom::ArticleNumber::Concerns::AsMarked
6
+
7
+ included do |includer|
8
+
9
+ has_many :ean8_barcodes, through: :markings, source: :barcode, source_type: 'Unidom::ArticleNumber::Ean8Barcode'
10
+
11
+ end
12
+
13
+ end
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module ArticleNumber
3
- VERSION = '1.2.1'.freeze
3
+ VERSION = '1.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: 1.2.1
4
+ version: '1.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: 2016-08-15 00:00:00.000000000 Z
11
+ date: 2016-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -41,6 +41,8 @@ files:
41
41
  - app/controllers/unidom/article_number/application_controller.rb
42
42
  - app/helpers/unidom/article_number/application_helper.rb
43
43
  - app/models/unidom/article_number/concerns/as_barcode.rb
44
+ - app/models/unidom/article_number/concerns/as_ean13_marked.rb
45
+ - app/models/unidom/article_number/concerns/as_ean8_marked.rb
44
46
  - app/models/unidom/article_number/concerns/as_marked.rb
45
47
  - app/models/unidom/article_number/concerns/code128_barcode.rb
46
48
  - app/models/unidom/article_number/ean13_barcode.rb