diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-03-19 02:44:51 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-03-19 02:44:51 +0900 |
commit | 59db5f22927135639d1fd77ea496ef1fb1679429 (patch) | |
tree | c1bd1cd385b08f85311bd686442ece6de13aa565 /activerecord/lib/active_record/relation | |
parent | cf4f05a7d4a2051cf3593bc7c3a6a216e74e797a (diff) | |
download | rails-59db5f22927135639d1fd77ea496ef1fb1679429.tar.gz rails-59db5f22927135639d1fd77ea496ef1fb1679429.tar.bz2 rails-59db5f22927135639d1fd77ea496ef1fb1679429.zip |
Use `load` rather than `collect` for force loading
Since b644964b `ActiveRecord::Relation` includes `Enumerable` so
delegating `collect`, `all?`, and `include?` are also unneeded.
`collect` without block returns `Enumerable` without preloading by that.
We should use `load` rather than `collect` for force loading.
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/delegation.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/delegation.rb b/activerecord/lib/active_record/relation/delegation.rb index 7b704c7e66..50378f9d99 100644 --- a/activerecord/lib/active_record/relation/delegation.rb +++ b/activerecord/lib/active_record/relation/delegation.rb @@ -36,7 +36,7 @@ module ActiveRecord # may vary depending on the klass of a relation, so we create a subclass of Relation # for each different klass, and the delegations are compiled into that subclass only. - delegate :to_xml, :encode_with, :length, :collect, :uniq, :each, :all?, :include?, :to_ary, :join, + delegate :to_xml, :encode_with, :length, :each, :uniq, :to_ary, :join, :[], :&, :|, :+, :-, :sample, :reverse, :compact, :in_groups, :in_groups_of, :to_sentence, :to_formatted_s, :as_json, :shuffle, :split, :index, to: :records |