Skip to content

Commit

Permalink
Removes unneeded caching from ActiveRecord::Base.relation
Browse files Browse the repository at this point in the history
  • Loading branch information
benedikt committed Apr 19, 2012
1 parent 2c21a2f commit ebfa58a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions activerecord/lib/active_record/base.rb
Expand Up @@ -450,12 +450,12 @@ def arel_engine
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
Expand Down Expand Up @@ -489,7 +489,6 @@ def initialize(attributes = nil, options = {})
@marked_for_destruction = false
@previously_changed = {}
@changed_attributes = {}
@relation = nil

ensure_proper_type

Expand Down

0 comments on commit ebfa58a

Please sign in to comment.