duck_puncher 4.5.0 → 4.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/duck_puncher/ducks/active_record.rb +7 -6
- data/lib/duck_puncher/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a1e2a545fad7e6c8fb369e3e205012a8929c8f7
|
4
|
+
data.tar.gz: 178c68f1a3c667f6aabcc216b690c63850b98f22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 223cfd0a857d5e38e1c261581a38e965e4135eff3b4d9158149529d9aea09729a742471580db5846870f7c1aeb951b9f6823631ef3a87f44ef23e2c733174c06
|
7
|
+
data.tar.gz: 92b02f4fba4fed7cdbd20820d5ecda2d9590a5ef5a4e277ab774cbe6f997ec4ecdc5441c953180e36e132890466ab7c0a18ecc610296f5b5b313e868bec49f3a
|
data/CHANGELOG.md
CHANGED
@@ -10,17 +10,18 @@ module DuckPuncher
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def associations
|
13
|
-
|
13
|
+
results = []
|
14
|
+
refls = send respond_to?(:reflections) ? :reflections : :_reflections
|
15
|
+
refls.each do |key, reflection|
|
14
16
|
begin
|
15
|
-
if reflection.macro.to_s =~ /many/
|
16
|
-
|
17
|
-
else
|
18
|
-
send(key).present?
|
17
|
+
if reflection.macro.to_s =~ /many/ ? public_send(key).exists? : public_send(key).present?
|
18
|
+
results << key
|
19
19
|
end
|
20
20
|
rescue
|
21
21
|
nil
|
22
22
|
end
|
23
|
-
|
23
|
+
end
|
24
|
+
results
|
24
25
|
end
|
25
26
|
|
26
27
|
module ClassMethods
|
data/lib/duck_puncher/version.rb
CHANGED