diff options
author | Matthew Draper <matthew@trebex.net> | 2016-12-31 10:05:46 +1030 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2016-12-31 10:05:46 +1030 |
commit | 64e5b897ac944a05a33275e3828a3d4047a6b457 (patch) | |
tree | fac1ce11ed79d70935001ebf1ed36c6876db79e7 /activerecord/lib/active_record/relation | |
parent | 6b126ffdcd8031bfe83fc311a230799c05e2c955 (diff) | |
download | rails-64e5b897ac944a05a33275e3828a3d4047a6b457.tar.gz rails-64e5b897ac944a05a33275e3828a3d4047a6b457.tar.bz2 rails-64e5b897ac944a05a33275e3828a3d4047a6b457.zip |
Mark internal cache constants as private
Closes #14640
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/delegation.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/delegation.rb b/activerecord/lib/active_record/relation/delegation.rb index 43dac0ed3d..3c1dea8c6c 100644 --- a/activerecord/lib/active_record/relation/delegation.rb +++ b/activerecord/lib/active_record/relation/delegation.rb @@ -15,7 +15,10 @@ module ActiveRecord delegate = Class.new(klass) { include ClassSpecificRelation } - const_set klass.name.gsub("::".freeze, "_".freeze), delegate + mangled_name = klass.name.gsub("::".freeze, "_".freeze) + const_set mangled_name, delegate + private_constant mangled_name + cache[klass] = delegate end end |