diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-05-30 17:26:15 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-05-30 17:27:34 -0700 |
commit | ac465d5dd2220acba26947ed3c6d29c11287e333 (patch) | |
tree | 5ab9a3a0bc29b40cd6b1028ac741e491c041d9bd /activerecord | |
parent | fe4dfdd64450662d882b47bf519d885edee453df (diff) | |
download | rails-ac465d5dd2220acba26947ed3c6d29c11287e333.tar.gz rails-ac465d5dd2220acba26947ed3c6d29c11287e333.tar.bz2 rails-ac465d5dd2220acba26947ed3c6d29c11287e333.zip |
Merge pull request #6558 from parndt/fix_regression
Fix regression
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 8c8717b759..9746efc7d1 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,6 +489,7 @@ module ActiveRecord #:nodoc: @marked_for_destruction = false @previously_changed = {} @changed_attributes = {} + @relation = nil ensure_proper_type |