Permalink
Browse files

Merge pull request #16550 from eileencodes/remove-unnecessary-to_s-fr…

…om-add_constraints-method

Remove to_s from reflection.type in add_constraints
  • Loading branch information...
rafaelfranca committed Aug 19, 2014
2 parents 6956dfc + 0e0e0db commit 57cf426e614be55c167b7e6ff04728da21ba5d33
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/associations/association_scope.rb
@@ -115,15 +115,15 @@ def add_constraints(scope, owner, assoc_klass, refl, tracker)
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
constraint = table[key].eq(foreign_table[foreign_key])
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

0 comments on commit 57cf426

Please sign in to comment.