Skip to content

Commit f818eb5

Browse files
authored
Merge pull request rails#33927 from bogdanvlviv/follow-up-33912
Make `ActiveRecord::Result#to_a` as alias to `ActiveRecord::Result#to_ary`
2 parents f1dcfc6 + 80e31d2 commit f818eb5

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

activerecord/lib/active_record/result.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ def each
6565
end
6666
end
6767

68-
# Returns an array of hashes representing each row record.
69-
def to_a
70-
hash_rows
71-
end
72-
7368
def to_hash
7469
ActiveSupport::Deprecation.warn(<<-MSG.squish)
7570
`ActiveRecord::Result#to_hash` has been renamed to `to_a`.
@@ -91,6 +86,8 @@ def to_ary
9186
hash_rows
9287
end
9388

89+
alias :to_a :to_ary
90+
9491
def [](idx)
9592
hash_rows[idx]
9693
end

0 commit comments

Comments
 (0)