diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2012-04-19 06:26:13 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2012-04-19 06:26:13 -0700 |
commit | b9e5c5aca3313bd67b35a608c504175f99172d7f (patch) | |
tree | 5075061b731f1203dca6551cb1b696a246c916b6 /activerecord/lib/active_record/base.rb | |
parent | 1166d49f62ccab789be208112163ad13183224e2 (diff) | |
parent | ebfa58abc895c0639211cb896a47b04e424322c8 (diff) | |
download | rails-b9e5c5aca3313bd67b35a608c504175f99172d7f.tar.gz rails-b9e5c5aca3313bd67b35a608c504175f99172d7f.tar.bz2 rails-b9e5c5aca3313bd67b35a608c504175f99172d7f.zip |
Merge pull request #5898 from benedikt/3-2-stable
Readds the fix for #5667 and back ports the regression fix from #5718
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-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 |