diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-09-28 16:57:24 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-09-28 16:57:24 -0700 |
commit | e1a10b15c20dc98f19b2a1b9d984d19bedfddcfa (patch) | |
tree | 57d42c29ef7edc1484458436f1b01fe2a118e253 /activerecord/lib/active_record/base.rb | |
parent | 8ca05c2ea2726671b46249a51dc9f5d44e965d46 (diff) | |
parent | 8dbf337e0a7e4db521aa2f5f992609fae98c329e (diff) | |
download | rails-e1a10b15c20dc98f19b2a1b9d984d19bedfddcfa.tar.gz rails-e1a10b15c20dc98f19b2a1b9d984d19bedfddcfa.tar.bz2 rails-e1a10b15c20dc98f19b2a1b9d984d19bedfddcfa.zip |
Merge pull request #7785 from okcwest/3-2-stable
backport 68677ffb8298105eb9d3efa26d928dd88cc5e006
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 7760736608..62c8110274 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 |