aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-09-20 18:58:50 +0900
committerGitHub <noreply@github.com>2018-09-20 18:58:50 +0900
commitf818eb558b6b3546705c754fe7c7beb64df3b425 (patch)
treef39bb4f161edbc58d6744d71200c77c2e477966d
parentf1dcfc6ccb9ceb0bfa76819acc2c3ed1bc691ef8 (diff)
parent80e31d217e798c2b440732a71e07db1cdc87ff87 (diff)
downloadrails-f818eb558b6b3546705c754fe7c7beb64df3b425.tar.gz
rails-f818eb558b6b3546705c754fe7c7beb64df3b425.tar.bz2
rails-f818eb558b6b3546705c754fe7c7beb64df3b425.zip
Merge pull request #33927 from bogdanvlviv/follow-up-33912
Make `ActiveRecord::Result#to_a` as alias to `ActiveRecord::Result#to_ary`
-rw-r--r--activerecord/lib/active_record/result.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/result.rb b/activerecord/lib/active_record/result.rb
index 453331e163..da6d10b6ec 100644
--- a/activerecord/lib/active_record/result.rb
+++ b/activerecord/lib/active_record/result.rb
@@ -65,11 +65,6 @@ module ActiveRecord
end
end
- # Returns an array of hashes representing each row record.
- def to_a
- hash_rows
- end
-
def to_hash
ActiveSupport::Deprecation.warn(<<-MSG.squish)
`ActiveRecord::Result#to_hash` has been renamed to `to_a`.
@@ -91,6 +86,8 @@ module ActiveRecord
hash_rows
end
+ alias :to_a :to_ary
+
def [](idx)
hash_rows[idx]
end