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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 197f08e7d41195a8d4d8281175dad2923da0a80d
4
- data.tar.gz: f8591266f5145352bdb4a9847e13ed84d6f67e1e
3
+ metadata.gz: 8a1e2a545fad7e6c8fb369e3e205012a8929c8f7
4
+ data.tar.gz: 178c68f1a3c667f6aabcc216b690c63850b98f22
5
5
  SHA512:
6
- metadata.gz: 05b387372a27b20a7d31a96d6e6b0cce79f59c963f0456925a3cd65c90a3514b87db0fda498c6dd597f7abdec179831b6c04c29eee9c8aaefe33aad24fa11b2b
7
- data.tar.gz: ea1ebe0ec61c32f7f0c3e3899a5dd21897cf43e702dd7688b97d5995135530380225a5e35663b106f53fd5ca1e450f973e85a15cab3d7ac76c8806d4a2f4daed
6
+ metadata.gz: 223cfd0a857d5e38e1c261581a38e965e4135eff3b4d9158149529d9aea09729a742471580db5846870f7c1aeb951b9f6823631ef3a87f44ef23e2c733174c06
7
+ data.tar.gz: 92b02f4fba4fed7cdbd20820d5ecda2d9590a5ef5a4e277ab774cbe6f997ec4ecdc5441c953180e36e132890466ab7c0a18ecc610296f5b5b313e868bec49f3a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 4.5.1 (01/19/2016)
2
+ ==================
3
+
4
+ * Fix `ActiveRecord#associations` for Rails 4
5
+
1
6
  4.5.0 (01/19/2016)
2
7
  ==================
3
8
 
@@ -10,17 +10,18 @@ module DuckPuncher
10
10
  end
11
11
 
12
12
  def associations
13
- reflections.select { |key, reflection|
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
- send(key).exists?
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
- }.keys
23
+ end
24
+ results
24
25
  end
25
26
 
26
27
  module ClassMethods
@@ -1,3 +1,3 @@
1
1
  module DuckPuncher
2
- VERSION = '4.5.0'.freeze
2
+ VERSION = '4.5.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duck_puncher
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.0
4
+ version: 4.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Buckley