aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2014-12-20 01:04:47 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2014-12-30 01:07:33 +0900
commit068160b444a5ceccd0bdc5dd81b70bc45754bcaa (patch)
tree9e2737135793c9701516bcafe3bba2e4cdbe47f6 /activerecord/lib/active_record
parentb67b57d47368b4b834cfe8c58d9e26f5c819c154 (diff)
downloadrails-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.rb1
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