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: d4f010eee5e3f7fe891d562d3c979f9eea89c4eb
4
- data.tar.gz: ab972bbf6f9be75db48226b7fd368e913a9cbef7
3
+ metadata.gz: a706f003c19750d1ce7ba106c80a141d7697ac9b
4
+ data.tar.gz: 25327826ed9af93e717410c3030156701a02b859
5
5
  SHA512:
6
- metadata.gz: 1a193e92d65dbeb4c413ebec142d050d7de787bef3778509bfa1f34b4ccc3899c910248f4dba7ca7f01686ecf229e0d21e82376b73843bbd3fd5f20e331ac658
7
- data.tar.gz: e35ecd3d201802ad4d9a2e0cef493f1ce735a746dbe5d176faddd09bc952c4ffb36a88faa35f553af515f8a902f14d3dd015a0e1d7204812aa8fc8dbb5753b68
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
- case attrs_to_calculate_item
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 | @attrs, ids)
30
+ calculated_values = calculator.calculate_many(calculator.attrs & @attrs, ids)
31
31
  merge_calculated_values(calculated_values)
32
32
  end
33
33
  end
@@ -1,3 +1,3 @@
1
1
  module CalculableAttrs
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calculable_attrs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Sharkov