mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
class names are already strings, so we do not need to call to_s on the strings that are already strings
This commit is contained in:
committed by
Vijay Dev
parent
2f0708e974
commit
a64bf22a71
@@ -88,7 +88,7 @@ module ActiveRecord
|
||||
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 @@ module ActiveRecord
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user