diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-05-27 16:52:42 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-05-27 21:07:39 +0200 |
commit | aff928bacfb26f164c3f0ccbee7bcfa8228941cb (patch) | |
tree | a990247d441525ba02ab335f33ec91b87ed80507 /activerecord/lib | |
parent | 95ce5062ca973d1cd66c94512fac968da74b0f3a (diff) | |
download | rails-aff928bacfb26f164c3f0ccbee7bcfa8228941cb.tar.gz rails-aff928bacfb26f164c3f0ccbee7bcfa8228941cb.tar.bz2 rails-aff928bacfb26f164c3f0ccbee7bcfa8228941cb.zip |
`implicit_readonly` is being removed in favor of calling `readonly` explicitly
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 6 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 5 |
2 files changed, 1 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 2439c3b440..9857ab0f8f 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -26,7 +26,6 @@ module ActiveRecord @klass = klass @table = table @values = values - @implicit_readonly = nil @loaded = false @default_scoped = false end @@ -582,10 +581,7 @@ module ActiveRecord ActiveRecord::Associations::Preloader.new(@records, associations).run end - # @readonly_value is true only if set explicitly. @implicit_readonly is true if there - # are JOINS and no explicit SELECT. - readonly = readonly_value.nil? ? @implicit_readonly : readonly_value - @records.each { |record| record.readonly! } if readonly + @records.each { |record| record.readonly! } if readonly_value else @records = default_scoped.to_a end diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index d020f1ba52..fe8fec4dfa 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -864,8 +864,6 @@ module ActiveRecord return [] if joins.empty? - @implicit_readonly = true - joins.map do |join| case join when Array @@ -947,8 +945,6 @@ module ActiveRecord join_dependency.graft(*stashed_association_joins) - @implicit_readonly = true unless association_joins.empty? && stashed_association_joins.empty? - # FIXME: refactor this to build an AST join_dependency.join_associations.each do |association| association.join_to(manager) @@ -961,7 +957,6 @@ module ActiveRecord def build_select(arel, selects) unless selects.empty? - @implicit_readonly = false arel.project(*selects) else arel.project(@klass.arel_table[Arel.star]) |