diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-11-10 23:33:39 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-11-10 23:33:39 +0900 |
commit | b1e068bd30a88fbcc93a835edd6dbacf1d2d251c (patch) | |
tree | 6e9e5c92fc745ac1a127d2dfd7cbe3c9a9f911a6 /activerecord/lib/active_record/associations | |
parent | df49896a1e67feea56062639c3cf51e8e0b12a51 (diff) | |
download | rails-b1e068bd30a88fbcc93a835edd6dbacf1d2d251c.tar.gz rails-b1e068bd30a88fbcc93a835edd6dbacf1d2d251c.tar.bz2 rails-b1e068bd30a88fbcc93a835edd6dbacf1d2d251c.zip |
Consolidate duplicated `to_ary`/`to_a` definitions in `Relation` and `CollectionProxy`
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_proxy.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index 07f7303f8d..8b4a48a38c 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -988,6 +988,12 @@ module ActiveRecord load_target == other end + ## + # :method: to_ary + # + # :call-seq: + # to_ary() + # # Returns a new array of objects from the collection. If the collection # hasn't been loaded, it fetches the records from the database. # @@ -1021,10 +1027,6 @@ module ActiveRecord # # #<Pet id: 5, name: "Brain", person_id: 1>, # # #<Pet id: 6, name: "Boss", person_id: 1> # # ] - def to_ary - load_target.dup - end - alias_method :to_a, :to_ary def records # :nodoc: load_target |