diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2014-12-20 01:04:47 +0900 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2014-12-30 01:07:33 +0900 |
commit | 068160b444a5ceccd0bdc5dd81b70bc45754bcaa (patch) | |
tree | 9e2737135793c9701516bcafe3bba2e4cdbe47f6 /activerecord/lib/active_record | |
parent | b67b57d47368b4b834cfe8c58d9e26f5c819c154 (diff) | |
download | rails-068160b444a5ceccd0bdc5dd81b70bc45754bcaa.tar.gz rails-068160b444a5ceccd0bdc5dd81b70bc45754bcaa.tar.bz2 rails-068160b444a5ceccd0bdc5dd81b70bc45754bcaa.zip |
`eager_load` preserves readonly flag for associations
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index cf63430a97..6c1c700d54 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -257,6 +257,7 @@ module ActiveRecord construct(model, node, row, rs, seen, model_cache, aliases) else model = construct_model(ar_parent, node, row, model_cache, id, aliases) + model.readonly! seen[parent.base_klass][primary_id][node.base_klass][id] = model construct(model, node, row, rs, seen, model_cache, aliases) end |