Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #16550 from eileencodes/remove-unnecessary-to_s-fr…
Browse files Browse the repository at this point in the history
…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 57cf426
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -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

Expand Down

0 comments on commit 57cf426

Please sign in to comment.