activeset 0.4.3 → 0.4.4

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: 985ab81bdeb7fee9fb11607b4e50b4ec5ac4b1e3
4
- data.tar.gz: 791083e078c49e5c38bbc6327dffc10ca9ff2967
3
+ metadata.gz: 40f42594ad16de88043af834c1fd25c435e35bcd
4
+ data.tar.gz: 064a4a104d040a1d28bafabdcf437a69bfe8baa5
5
5
  SHA512:
6
- metadata.gz: 6c4e69fc91d470df0c4aab606aeb9fa790353600ed921c3e50ff9ec3aee14ba147ae2d4821482f6f3ecb2941a315c3341290f85775b4f19aa1d8ca0a80488142
7
- data.tar.gz: e0d5b888645d88a1fdf0840238a586da1bec40146471a89114d5b5609c0fc065580276eb5a2487de8249135ccb098aabb44a7e9495b492480b25cc1c42585573
6
+ metadata.gz: 071f0b2aa19d7691660693a6cfdca52cb6bbf7fd3c4cbab7deea0d6e5c651e5c2445e4f47932f08f31bb006604489135ed8dc9c50bd008cf9e8d7d0b3d7c6807
7
+ data.tar.gz: f77c58fdef21bd82910ffaed576584cb736398170cf4ef1f9d637364b0144034dda06c7c35c48f71edce83102ceabd50c5c90975cc30b701998b9ced2dcaaa51
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v 0.4.4
2
+ - Ensure that the ActiveRecord filterer can handle Rails4 AR::Relations not responding to :methods on the underlying class
3
+ - Test scopes defined using the helper but also as simply class methods
1
4
  v 0.4.3
2
5
  - Properly specify the version dependency on ActiveSupport
3
6
  v 0.4.2
@@ -49,10 +49,12 @@ class ActiveSet
49
49
  end
50
50
 
51
51
  def attribute_model
52
- @instruction.associations_array
53
- .reduce(@set) do |obj, assoc|
54
- obj.reflections[assoc.to_s]&.klass
55
- end
52
+ tmp_model = @instruction.associations_array
53
+ .reduce(@set) do |obj, assoc|
54
+ obj.reflections[assoc.to_s]&.klass
55
+ end
56
+ return tmp_model.klass if tmp_model.is_a?(ActiveRecord::Relation)
57
+ tmp_model
56
58
  end
57
59
 
58
60
  def arel_eager_load_associations
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ActiveSet
4
- VERSION = '0.4.3'
4
+ VERSION = '0.4.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeset
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Margheim
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-11 00:00:00.000000000 Z
11
+ date: 2017-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport