From d289e15af9b2749ba0ab9534b5469287be6ece05 Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Mon, 22 Mar 2010 15:43:14 -0300 Subject: From and lock should be defined to be consistent with other ivars. Limit and offset are always defined, no need to test that. [#4253 state:committed] Signed-off-by: Jeremy Kemper --- activerecord/lib/active_record/relation.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'activerecord/lib/active_record/relation.rb') diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 1a84f70a8e..a20c152eeb 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -15,13 +15,10 @@ module ActiveRecord def initialize(klass, table) @klass, @table = klass, table - @readonly_value = nil - @create_with_value = nil @implicit_readonly = nil - @limit_value = nil - @offset_value = nil @loaded = nil + SINGLE_VALUE_METHODS.each {|v| instance_variable_set(:"@#{v}_value", nil)} (ASSOCIATION_METHODS + MULTI_VALUE_METHODS).each {|v| instance_variable_set(:"@#{v}_values", [])} end @@ -62,7 +59,7 @@ module ActiveRecord preload = @preload_values preload += @includes_values unless eager_loading? - preload.each {|associations| @klass.send(:preload_associations, @records, associations) } + preload.each {|associations| @klass.send(:preload_associations, @records, associations) } # @readonly_value is true only if set explicity. @implicit_readonly is true if there are JOINS and no explicit SELECT. readonly = @readonly_value.nil? ? @implicit_readonly : @readonly_value -- cgit v1.2.3