diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-11-08 20:28:52 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-11-08 20:28:52 +0900 |
commit | 65aa0b7e3448f849a91b6f510b78d4303ff44dbc (patch) | |
tree | 07dd6dbe26fbc533356e3cf9334dd2f87c453673 /activerecord | |
parent | 0c2cb880e34c943275758ca6a6ff84afa7a29fba (diff) | |
download | rails-65aa0b7e3448f849a91b6f510b78d4303ff44dbc.tar.gz rails-65aa0b7e3448f849a91b6f510b78d4303ff44dbc.tar.bz2 rails-65aa0b7e3448f849a91b6f510b78d4303ff44dbc.zip |
Don't expose accessors which are internal used only
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/associations/preloader.rb | 5 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/preloader/association.rb | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/preloader.rb b/activerecord/lib/active_record/associations/preloader.rb index e1754d4a19..5a93a89d0a 100644 --- a/activerecord/lib/active_record/associations/preloader.rb +++ b/activerecord/lib/active_record/associations/preloader.rb @@ -166,8 +166,6 @@ module ActiveRecord end class AlreadyLoaded # :nodoc: - attr_reader :owners, :reflection - def initialize(klass, owners, reflection, preload_scope) @owners = owners @reflection = reflection @@ -178,6 +176,9 @@ module ActiveRecord def preloaded_records owners.flat_map { |owner| owner.association(reflection.name).target } end + + protected + attr_reader :owners, :reflection end # Returns a class containing the logic needed to load preload the data diff --git a/activerecord/lib/active_record/associations/preloader/association.rb b/activerecord/lib/active_record/associations/preloader/association.rb index e77761692d..19c337dc39 100644 --- a/activerecord/lib/active_record/associations/preloader/association.rb +++ b/activerecord/lib/active_record/associations/preloader/association.rb @@ -4,7 +4,6 @@ module ActiveRecord module Associations class Preloader class Association #:nodoc: - attr_reader :owners, :reflection, :preload_scope, :model, :klass attr_reader :preloaded_records def initialize(klass, owners, reflection, preload_scope) @@ -28,6 +27,9 @@ module ActiveRecord end end + protected + attr_reader :owners, :reflection, :preload_scope, :model, :klass + private # The name of the key on the associated records def association_key_name |