aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/associations.rb2
-rw-r--r--activerecord/lib/active_record/reflection.rb2
2 files changed, 2 insertions, 2 deletions
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 <tt>:autosave</tt> enabled.