diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2016-03-08 11:46:11 +0900 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2016-07-30 15:28:33 +0900 |
commit | 411e4597d552aa091cfe3dc76a83bdaffe02da1a (patch) | |
tree | a7c06d6df27915249734789f7f995b55f17e79e6 /activerecord/lib/active_record/associations/preloader | |
parent | 815b730b1b79158511f9f4c8465c476b9fe9b7e0 (diff) | |
download | rails-411e4597d552aa091cfe3dc76a83bdaffe02da1a.tar.gz rails-411e4597d552aa091cfe3dc76a83bdaffe02da1a.tar.bz2 rails-411e4597d552aa091cfe3dc76a83bdaffe02da1a.zip |
Preserve readonly flag only for readonly association
Fixes #24093
Diffstat (limited to 'activerecord/lib/active_record/associations/preloader')
-rw-r--r-- | activerecord/lib/active_record/associations/preloader/association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/preloader/association.rb b/activerecord/lib/active_record/associations/preloader/association.rb index 3032bc786e..f7b9aa7785 100644 --- a/activerecord/lib/active_record/associations/preloader/association.rb +++ b/activerecord/lib/active_record/associations/preloader/association.rb @@ -113,7 +113,7 @@ module ActiveRecord end def reflection_scope - @reflection_scope ||= reflection.scope ? klass.unscoped.instance_exec(nil, &reflection.scope) : klass.unscoped + @reflection_scope ||= reflection.scope_for(klass) end def build_scope |