aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/spawn_methods.rb
diff options
context:
space:
mode:
authorBen Maraney <ben@maraney.com>2013-08-30 12:25:10 +0300
committerBen Maraney <ben@maraney.com>2013-08-30 12:58:41 +0300
commitcf1904f65bffcf6833903d4a30770eddc5713486 (patch)
tree98c90f83015d2c900dbe1e65d8cb4e828a8ab0af /activerecord/lib/active_record/relation/spawn_methods.rb
parent59a35610459da7368e79179c9d33bc6e4697adb1 (diff)
downloadrails-cf1904f65bffcf6833903d4a30770eddc5713486.tar.gz
rails-cf1904f65bffcf6833903d4a30770eddc5713486.tar.bz2
rails-cf1904f65bffcf6833903d4a30770eddc5713486.zip
Fix STI scopes using benolee's suggestion. Fixes #11939
Diffstat (limited to 'activerecord/lib/active_record/relation/spawn_methods.rb')
-rw-r--r--activerecord/lib/active_record/relation/spawn_methods.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb
index b734fc5c51..93fa30eb38 100644
--- a/activerecord/lib/active_record/relation/spawn_methods.rb
+++ b/activerecord/lib/active_record/relation/spawn_methods.rb
@@ -151,7 +151,7 @@ module ActiveRecord
values = other.joins_values
return if values.blank?
- if other.klass == relation.klass
+ if other.klass >= relation.klass
relation.joins_values += values
else
joins_dependency, rest = values.partition do |join|