提交 57cf426e 编写于 作者: R Rafael Mendonça França

Merge pull request #16550 from eileencodes/remove-unnecessary-to_s-from-add_constraints-method

Remove to_s from reflection.type in add_constraints
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册