From 0e0e0db416fc193766f0b21d61fc8f9dfadfe95e Mon Sep 17 00:00:00 2001 From: eileencodes Date: Mon, 18 Aug 2014 20:02:51 -0400 Subject: 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 --- activerecord/lib/active_record/associations/association_scope.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib') 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 -- cgit v1.2.3