提交 f2234a5d 编写于 作者: A Aaron Patterson

class names are already strings, so we do not need to call to_s on the strings...

class names are already strings, so we do not need to call to_s on the strings that are already strings
上级 82058288
......@@ -88,7 +88,7 @@ def construct_joins
def construct_owner_attributes(reflection)
if as = reflection.options[:as]
{ "#{as}_id" => @owner.id,
"#{as}_type" => @owner.class.base_class.name.to_s }
"#{as}_type" => @owner.class.base_class.name }
else
{ reflection.primary_key_name => @owner.id }
end
......@@ -102,7 +102,7 @@ def construct_join_attributes(associate)
join_attributes = construct_owner_attributes(@reflection.through_reflection).merge(@reflection.source_reflection.primary_key_name => associate.id)
if @reflection.options[:source_type]
join_attributes.merge!(@reflection.source_reflection.options[:foreign_type] => associate.class.base_class.name.to_s)
join_attributes.merge!(@reflection.source_reflection.options[:foreign_type] => associate.class.base_class.name)
end
if @reflection.through_reflection.options[:conditions].is_a?(Hash)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册