Skip to content

Commit

Permalink
class names are already strings, so we do not need to call to_s on th…
Browse files Browse the repository at this point in the history
…e strings that are already strings
  • Loading branch information
tenderlove committed Dec 14, 2010
1 parent 8205828 commit f2234a5
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit f2234a5

Please sign in to comment.