diff options
author | Benedikt Deicke <benedikt@synatic.net> | 2012-04-19 10:07:28 +0200 |
---|---|---|
committer | Benedikt Deicke <benedikt@synatic.net> | 2012-04-19 10:07:28 +0200 |
commit | ebfa58abc895c0639211cb896a47b04e424322c8 (patch) | |
tree | 5075061b731f1203dca6551cb1b696a246c916b6 /activerecord/lib | |
parent | 2c21a2f7eb9f8cc50a3e957784105e187f63d5f3 (diff) | |
download | rails-ebfa58abc895c0639211cb896a47b04e424322c8.tar.gz rails-ebfa58abc895c0639211cb896a47b04e424322c8.tar.bz2 rails-ebfa58abc895c0639211cb896a47b04e424322c8.zip |
Removes unneeded caching from ActiveRecord::Base.relation
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 9746efc7d1..8c8717b759 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -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 |