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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/hash_builder/version.rb +1 -1
- data/lib/hash_builder.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f31286f2de4706ef01211bad659937fc253eda0a
|
4
|
+
data.tar.gz: aade2dbcfa2e6d9433714854deb89b24870bc592
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06f64025381c429c0a535ed7810918e5e1c7fadebb0a4956f0076cd53e68b23cd9d8fe73a5c485095bd4175cf0ca850a0df14de7f6ed3126fc0c340dd7267063
|
7
|
+
data.tar.gz: a3907cf1b5a61c2b7ba699992ecf0a10735ac5a7783bb8d3b309964a8d3bde66340004ee89e36f19110b2540f697a403324db68633c9c5ca39c6eed601cde5cb
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/hash_builder/version.rb
CHANGED
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
|
-
|
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
|