Skip to content

Commit

Permalink
Fix inject/reduce.
Browse files Browse the repository at this point in the history
  • Loading branch information
beauby committed Sep 21, 2015
1 parent 3f00e79 commit 273f0a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_model/serializer/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def include_args_to_hash(included)
end

def nested_lookup_paths(klass)
paths = klass.to_s.split('::').reverse.inject([]) { |a, e| a + [[e] + Array(a.last)] }.reverse
paths = klass.to_s.split('::').reverse.reduce([]) { |a, e| a + [[e] + Array(a.last)] }.reverse
paths.map! { |path| "::#{path.join('::')}" }
paths.select! { |path| Object.const_defined?(path, false) }
paths.map! { |path| Object.const_get(path) }
Expand Down

0 comments on commit 273f0a7

Please sign in to comment.