unidom-standard 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 113814c02dc233f2dbc19941603bdb6e019eb813
|
4
|
+
data.tar.gz: 1f56fead8bc694f3598b67386e8d882fd7ab3a8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54c9fb53ed175c40e27eecc15fa7310de10694ac2a36c265a912b5ee5070f36fec191849582ab309b957df13f22748098ffa38036df9e2ed661093b4a8a7478b
|
7
|
+
data.tar.gz: 4c16e96fce26a1059e5c944db31af668b3c5f67986196f8aadd158c358cc53765212de49d851f38c9995bc250ca911652d9e910227117986d0215cdaf64b30d4
|
data/README.md
CHANGED
@@ -46,9 +46,11 @@ The As Source Standard concern do the following tasks for the includer automatic
|
|
46
46
|
1. Define the has_many :target_associatings macro as: ``has_many :target_associatings, class_name: 'Unidom::Standard::StandardAssociating', foreign_key: :source_id``
|
47
47
|
2. Define the has_many :target_standards macro as: ``has_many :target_standards, through: :target_associatings, source: :target``
|
48
48
|
3. Define the #associate! method as: ``associate!(target, due_to: 'REVS', at: Time.now)``
|
49
|
+
4. Define the #associate? method as: ``associate?(target, due_to: 'REVS', at: Time.now)``
|
49
50
|
|
50
51
|
### As Target Standard concern
|
51
52
|
The As Target Standard concern do the following tasks for the includer automatically:
|
52
53
|
1. Define the has_many :source_associatings macro as: ``has_many :source_associatings, class_name: 'Unidom::Standard::StandardAssociating', foreign_key: :target_id``
|
53
54
|
2. Define the has_many :source_standards macro as: ``has_many :source_standards, through: :source_associatings, source: :source``
|
54
55
|
3. Define the #is_associated! method as: ``is_associated!(source, due_to: 'REVS', at: Time.now)``
|
56
|
+
4. Define the #is_associated? method as: ``is_associated?(source, due_to: 'REVS', at: Time.now)``
|
@@ -11,9 +11,9 @@ module Unidom::Standard::Concerns::AsSourceStandard
|
|
11
11
|
target_associatings.target_is(target).association_coded_as(due_to).valid_at(now: at).alive.first_or_create! opened_at: at
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
def associate?(target, due_to: 'REVS', at: Time.now)
|
15
|
+
target_associatings.target_is(target).association_coded_as(due_to).valid_at(now: at).alive.exists?
|
16
|
+
end
|
17
17
|
|
18
18
|
end
|
19
19
|
|
@@ -11,9 +11,9 @@ module Unidom::Standard::Concerns::AsTargetStandard
|
|
11
11
|
source_associatings.source_is(source).association_coded_as(due_to).valid_at(now: at).alive.first_or_create! opened_at: at
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
def is_associated?(source, due_to: 'REVS', at: Time.now)
|
15
|
+
source_associatings.source_is(source).association_coded_as(due_to).valid_at(now: at).alive.exists?
|
16
|
+
end
|
17
17
|
|
18
18
|
end
|
19
19
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-standard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '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-09-
|
11
|
+
date: 2016-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|