提交 c322b7c2 编写于 作者: N Nick LaMuro

Adds .to_s to table_name call

Avoids a NoMethodError when table_name is a symbol instead of a string.
上级 b42e594a
......@@ -44,7 +44,7 @@ def associated_with?(association_name)
end
def associated_table(table_name)
association = klass._reflect_on_association(table_name) || klass._reflect_on_association(table_name.singularize)
association = klass._reflect_on_association(table_name) || klass._reflect_on_association(table_name.to_s.singularize)
if !association && table_name == arel_table.name
return self
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册