Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 57cf426e614be55c167b7e6ff04728da21ba5d33 2 parents 6956dfc + 0e0e0db
@rafaelfranca rafaelfranca authored
View
4 activerecord/lib/active_record/associations/association_scope.rb
@@ -115,7 +115,7 @@ 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
@@ -123,7 +123,7 @@ def add_constraints(scope, owner, assoc_klass, refl, tracker)
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
Please sign in to comment.
Something went wrong with that request. Please try again.