diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-08-18 23:17:23 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-08-18 23:17:23 -0300 |
commit | 28aaf77bb07af5e0108ff986e192e71da6d25078 (patch) | |
tree | 264a7b3676e48033f9f86b07de49f914800a8877 /activerecord/lib/active_record/associations/preloader | |
parent | 085166d59a039bce0e45979a2dec25160bc80f14 (diff) | |
parent | 411e4597d552aa091cfe3dc76a83bdaffe02da1a (diff) | |
download | rails-28aaf77bb07af5e0108ff986e192e71da6d25078.tar.gz rails-28aaf77bb07af5e0108ff986e192e71da6d25078.tar.bz2 rails-28aaf77bb07af5e0108ff986e192e71da6d25078.zip |
Merge pull request #24099 from k0kubun/preserve-readonly
Preserve readonly flag only for readonly association
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 a8afa48865..4bb627f399 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 |