Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removes unneeded caching from ActiveRecord::Base.relation

  • Loading branch information...
commit ebfa58abc895c0639211cb896a47b04e424322c8 1 parent 2c21a2f
@benedikt authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 activerecord/lib/active_record/base.rb
View
7 activerecord/lib/active_record/base.rb
@@ -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
@@ -489,7 +489,6 @@ def initialize(attributes = nil, options = {})
@marked_for_destruction = false
@previously_changed = {}
@changed_attributes = {}
- @relation = nil
ensure_proper_type
Please sign in to comment.
Something went wrong with that request. Please try again.