calculable_attrs 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a706f003c19750d1ce7ba106c80a141d7697ac9b
|
4
|
+
data.tar.gz: 25327826ed9af93e717410c3030156701a02b859
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76d51005b20fb102111c114cbf17c67538a7c1dbcbdbff5075e3171e7930058367f18fddd9e24d4743ff7fe8de9544b1cedcffd96031fb4386d5e4bd382ca439
|
7
|
+
data.tar.gz: 6c6419daec2748d65b236d70f599b5bc54d13eac830677f2ab5b43a15084081420dcad0cfb924b8a650faf5b77493b6e7180c4271199fc5e45c5ff6f4497e9d9
|
@@ -54,7 +54,7 @@ module CalculableAttrs::ActiveRecord::Relation
|
|
54
54
|
scope = (models_calculable_scopes[klass] ||= CalculableAttrs::ModelCalculableAttrsScope.new(klass))
|
55
55
|
attrs_to_calculate.each do |attrs_to_calculate_item|
|
56
56
|
|
57
|
-
|
57
|
+
case attrs_to_calculate_item
|
58
58
|
when Symbol
|
59
59
|
if klass.reflect_on_association(attrs_to_calculate_item)
|
60
60
|
collect_association_calculable_attrs(models_calculable_scopes, klass, attrs_to_calculate_item, true)
|
@@ -27,7 +27,7 @@ class CalculableAttrs::ModelCalculableAttrsScope
|
|
27
27
|
def calculate
|
28
28
|
@calculable_attrs_values = nil
|
29
29
|
calculators_to_use.each do |calculator|
|
30
|
-
calculated_values = calculator.calculate_many(attrs
|
30
|
+
calculated_values = calculator.calculate_many(calculator.attrs & @attrs, ids)
|
31
31
|
merge_calculated_values(calculated_values)
|
32
32
|
end
|
33
33
|
end
|