activerecord-precount 0.4.1 → 0.4.2
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: 558ab186a4ad75d87bd48d8035248b0a72170a33
|
4
|
+
data.tar.gz: 41746e4e827dfa0bb315730e0827682efef19072
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03436420d1477fe170c6768e9b06f4c4b9ced3bd4ed4c91584023d00a88f789c8d204cab60701b3f3e8f0ee6027626b47ab62ca3c80581414b0e613ff0f61f4d
|
7
|
+
data.tar.gz: 6c7ce07a028ff757ba67fe6620de75204fa67c5d29f503569839c412890a412996c9e2345938b5fabb763339d27a6f41a7e7ee8eca1e16bfa82c17dfe37e697d
|
@@ -7,8 +7,8 @@ module ActiveRecord
|
|
7
7
|
counter_name = :"#{@association.reflection.name}_count"
|
8
8
|
owner = @association.owner
|
9
9
|
|
10
|
-
if owner.class.has_reflection?(counter_name)
|
11
|
-
owner.
|
10
|
+
if owner.class.has_reflection?(counter_name) && owner.association(counter_name).loaded?
|
11
|
+
owner.association(counter_name).target
|
12
12
|
else
|
13
13
|
super(*args)
|
14
14
|
end
|