Use .to_s on _reflections lookup

上级 09ac448a
......@@ -1612,7 +1612,7 @@ def destroy_associations
has_many name, scope, hm_options, &extension
reflection = ActiveRecord::Reflection::AssociationReflection.new(:has_and_belongs_to_many, name, scope, options, self)
self.reflections = self.reflections.except(middle_reflection.name).merge!(name => reflection)
self.reflections = self.reflections.except(middle_reflection.name).merge!(name.to_s => reflection)
end
end
end
......
......@@ -85,7 +85,7 @@ def reflect_on_association(association)
# @api private
def _reflect_on_association(association) #:nodoc:
_reflections[association]
_reflections[association.to_s]
end
# Returns an array of AssociationReflection objects for all associations which have <tt>:autosave</tt> enabled.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册