unidom-product 1.2 → 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: fa1f24747854ba625570c9bebe26608694366c4e
4
- data.tar.gz: c8a3d6e396c504d9a6297999e6f370e5e91afb87
3
+ metadata.gz: 5974304bb2eb68ffab1a5c2813e8727dd65f79dc
4
+ data.tar.gz: 020bf02365fdcb42a0727c57a260b73e98cc5e9d
5
5
  SHA512:
6
- metadata.gz: 1199f8ca0da3d579897a1f56579c640b5687538f33bf0db8f185f506f4f31d0f8fe8bf78562e1ae3e8c63dcd346e0e95cb1879b4f8161e9758e2f1ec14e3c4f3
7
- data.tar.gz: d19512da38b9e5f2f264439f1fb69bf04c23a1e214ebf76a35186f6d8f8c0741fae260c400a823f1e40980149912a876a30c9905e4d909d77365c286e3ade453
6
+ metadata.gz: ee61ade26e85062a2354482b678d7785119278452e8f04462a5fe008c4ae174b0dbe1dc1f3bc5ad80fafa30ed5a675666a9a2592e35ba79c121a9ecfcaff71e9
7
+ data.tar.gz: 79ac272f66669c7b17879fcd289cdeccc3ebd936472d4ba56eba46ec8dd4c1db4bd93567c0e44b6aedd04725ae038dfcce0fffcacb014b2350c9db7b2b4ce961
data/README.md CHANGED
@@ -68,9 +68,11 @@ The As Source Product Associating concern do the following tasks for the include
68
68
  1. Define the has_many :target_product_associatings macro as: ``has_many :target_product_associatings, class_name: 'Unidom::Product::ProductAssociating', foreign_key: :source_id``
69
69
  2. Define the has_many :target_products macro as: ``has_many :target_products, through: :target_product_associatings, source: :target``
70
70
  3. Define the #associate! method as: ``associate!(target, due_to: nil, at: Time.now, ordinal: 1)``
71
+ 4. Define the #associate? method as: ``associate?(target, due_to: nil, at: Time.now)``
71
72
 
72
73
  ### As Target Product Associating concern
73
74
  The As Target Product Associating concern do the following tasks for the includer automatically:
74
75
  1. Define the has_many :source_product_associatings macro as: ``has_many :source_product_associatings, class_name: 'Unidom::Product::ProductAssociating', foreign_key: :target_id``
75
76
  2. Define the has_many :source_products macro as: ``has_many :source_products, through: :source_product_associatings, source: :source``
76
77
  3. Define the #is_associated! method as: ``is_associated!(source, due_to: nil, at: Time.now, ordinal: 1)``
78
+ 4. Define the #is_associated? method as: ``is_associated?(source, due_to: nil, at: Time.now)``
@@ -7,9 +7,9 @@ module Unidom::Product::Concerns::AsSourceProductAssociating
7
7
  has_many :target_product_associatings, class_name: 'Unidom::Product::ProductAssociating', foreign_key: :source_id
8
8
  has_many :target_products, through: :target_product_associatings, source: :target
9
9
 
10
- #def associate?(target, due_to: nil, at: Time.now)
11
- # target_product_associatings.target_is(target).product_association_coded_as(due_to).valid_at(now: at).alive.exists?
12
- #end
10
+ def associate?(target, due_to: nil, at: Time.now)
11
+ target_product_associatings.target_is(target).product_association_coded_as(due_to).valid_at(now: at).alive.exists?
12
+ end
13
13
 
14
14
  def associate!(target, due_to: nil, at: Time.now, ordinal: 1)
15
15
  target_product_associatings.target_is(target).product_association_coded_as(due_to).valid_at(now: at).alive.first_or_create! ordinal: ordinal, opened_at: at
@@ -7,9 +7,9 @@ module Unidom::Product::Concerns::AsTargetProductAssociating
7
7
  has_many :source_product_associatings, class_name: 'Unidom::Product::ProductAssociating', foreign_key: :target_id
8
8
  has_many :source_products, through: :source_product_associatings, source: :source
9
9
 
10
- #def is_associated?(source, due_to: nil, at: Time.now)
11
- # source_product_associatings.source_is(source).product_association_coded_as(due_to).valid_at(now: at).alive.exists?
12
- #end
10
+ def is_associated?(source, due_to: nil, at: Time.now)
11
+ source_product_associatings.source_is(source).product_association_coded_as(due_to).valid_at(now: at).alive.exists?
12
+ end
13
13
 
14
14
  def is_associated!(source, due_to: nil, at: Time.now, ordinal: 1)
15
15
  source_product_associatings.source_is(source).product_association_coded_as(due_to).valid_at(now: at).alive.first_or_create! ordinal: ordinal, opened_at: at
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Product
3
- VERSION = '1.2'.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-product
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.2'
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-09-30 00:00:00.000000000 Z
11
+ date: 2016-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common