From 6259e4e2dcca9a79f22f96658c33efe81936bc0d Mon Sep 17 00:00:00 2001 From: Arthur Neves Date: Sat, 24 May 2014 14:04:17 -0400 Subject: Use .to_s on _reflections lookup --- activerecord/lib/active_record/associations.rb | 2 +- activerecord/lib/active_record/reflection.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 1db12a3f6c..68a386f8db 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1612,7 +1612,7 @@ module ActiveRecord 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 diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index b725632e25..e24ad54be3 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -85,7 +85,7 @@ module ActiveRecord # @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 :autosave enabled. -- cgit v1.2.3