aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2016-10-31 10:31:00 -0500
committerGitHub <noreply@github.com>2016-10-31 10:31:00 -0500
commit3c9eb704e8b7fc175728f0340043b888120764cc (patch)
tree002aa675b65c76bdedc042ef6a3146e18620eed0 /activerecord/lib
parent7056273845d5f8307f80b98e0ae7a39e6e95ba0b (diff)
parent1d6b62026b3fbb17215b3a33c9606b5d9bd415dc (diff)
downloadrails-3c9eb704e8b7fc175728f0340043b888120764cc.tar.gz
rails-3c9eb704e8b7fc175728f0340043b888120764cc.tar.bz2
rails-3c9eb704e8b7fc175728f0340043b888120764cc.zip
Merge pull request #26838 from Cohen-Carlisle/activerecord-slice-array-args
allow ActiveRecord::Core#slice to use array arg
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/core.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb
index d24bd4efa8..0a9c06ba59 100644
--- a/activerecord/lib/active_record/core.rb
+++ b/activerecord/lib/active_record/core.rb
@@ -538,7 +538,7 @@ module ActiveRecord
# Returns a hash of the given methods with their names as keys and returned values as values.
def slice(*methods)
- Hash[methods.map! { |method| [method, public_send(method)] }].with_indifferent_access
+ Hash[methods.flatten.map! { |method| [method, public_send(method)] }].with_indifferent_access
end
private