Removes unneeded caching from ActiveRecord::Base.relation

This commit is contained in:
Benedikt Deicke
2012-04-19 10:07:28 +02:00
parent 2c21a2f7eb
commit ebfa58abc8

View File

@@ -450,12 +450,12 @@ module ActiveRecord #:nodoc:
private
def relation #:nodoc:
@relation ||= Relation.new(self, arel_table)
relation ||= Relation.new(self, arel_table)
if finder_needs_type_condition?
@relation.where(type_condition).create_with(inheritance_column.to_sym => sti_name)
relation.where(type_condition).create_with(inheritance_column.to_sym => sti_name)
else
@relation
relation
end
end
end
@@ -489,7 +489,6 @@ module ActiveRecord #:nodoc:
@marked_for_destruction = false
@previously_changed = {}
@changed_attributes = {}
@relation = nil
ensure_proper_type