hash_builder 0.2.0 → 0.2.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: faad6edf321e3f342176b49d7609e0571d97bb97
4
- data.tar.gz: 6760b476808d2998613b9f19f79a0a95c0ce473f
3
+ metadata.gz: f31286f2de4706ef01211bad659937fc253eda0a
4
+ data.tar.gz: aade2dbcfa2e6d9433714854deb89b24870bc592
5
5
  SHA512:
6
- metadata.gz: 70413930a07dce15f1a1ec8c3cfe7acc6b92176a23395bf3c65053c169e0cfee3ba94e760d84d7fc3fb091fae3928e5409e72a132b1895aefe87db4d2da5abcb
7
- data.tar.gz: f18883d701e0b11d710a81aadc1567895fca6bec5c513b1ae2cd7658ca499eec7a0d091206220fae07ffd7070de9ef21e1466ad02d8504dfcf2ed3dae0207836
6
+ metadata.gz: 06f64025381c429c0a535ed7810918e5e1c7fadebb0a4956f0076cd53e68b23cd9d8fe73a5c485095bd4175cf0ca850a0df14de7f6ed3126fc0c340dd7267063
7
+ data.tar.gz: a3907cf1b5a61c2b7ba699992ecf0a10735ac5a7783bb8d3b309964a8d3bde66340004ee89e36f19110b2540f697a403324db68633c9c5ca39c6eed601cde5cb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hash_builder (0.2.0)
4
+ hash_builder (0.2.1)
5
5
  exec_env
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -122,7 +122,7 @@ array @users do |user|
122
122
  end
123
123
  ```
124
124
 
125
- Would result in
125
+ This results in
126
126
 
127
127
  ```json
128
128
  [
@@ -1,3 +1,3 @@
1
1
  module HashBuilder
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/hash_builder.rb CHANGED
@@ -31,8 +31,9 @@ module HashBuilder
31
31
 
32
32
  messages.each do |(name, args, block)|
33
33
  arg = args.first
34
-
35
- if args.size == 1 && block && arg.is_a?(Enumerable) && !arg.is_a?(Hash)
34
+
35
+ # ActiveRecord relations respond to :map but are no Enumerable
36
+ if args.size == 1 && block && arg.respond_to?(:map) && !arg.is_a?(Hash)
36
37
  hash[name] = arg.map do |*objects|
37
38
  HashBuilder.build(args: objects, scope: scope, locals: locals, &block)
38
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hash_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Lienen