aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authoreileencodes <eileencodes@gmail.com>2014-08-18 20:02:51 -0400
committereileencodes <eileencodes@gmail.com>2014-08-18 20:02:51 -0400
commit0e0e0db416fc193766f0b21d61fc8f9dfadfe95e (patch)
tree8af3d3d4ffaddac33e252222392b5db0fc16783d /activerecord
parent6956dfcaa2733948337f1074057221e7ab85f3b4 (diff)
downloadrails-0e0e0db416fc193766f0b21d61fc8f9dfadfe95e.tar.gz
rails-0e0e0db416fc193766f0b21d61fc8f9dfadfe95e.tar.bz2
rails-0e0e0db416fc193766f0b21d61fc8f9dfadfe95e.zip
Remove to_s from reflection.type in add_constraints
The instance var is already saved as a string in the initialization method of AssociationReflection. See https://github.com/rails/rails/blob/master/activerecord/lib/active_record/reflection.rb#L273
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/association_scope.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/association_scope.rb b/activerecord/lib/active_record/associations/association_scope.rb
index 519d4d8651..4c47af8cb0 100644
--- a/activerecord/lib/active_record/associations/association_scope.rb
+++ b/activerecord/lib/active_record/associations/association_scope.rb
@@ -115,7 +115,7 @@ module ActiveRecord
if reflection.type
value = owner.class.base_class.name
- bind_val = bind scope, table.table_name, reflection.type.to_s, value, tracker
+ bind_val = bind scope, table.table_name, reflection.type, value, tracker
scope = scope.where(table[reflection.type].eq(bind_val))
end
else
@@ -123,7 +123,7 @@ module ActiveRecord
if reflection.type
value = chain[i + 1].klass.base_class.name
- bind_val = bind scope, table.table_name, reflection.type.to_s, value, tracker
+ bind_val = bind scope, table.table_name, reflection.type, value, tracker
scope = scope.where(table[reflection.type].eq(bind_val))
end