diff options
author | Arthur Neves <arthurnn@gmail.com> | 2014-05-24 14:04:17 -0400 |
---|---|---|
committer | Arthur Neves <arthurnn@gmail.com> | 2014-05-24 14:55:30 -0400 |
commit | 6259e4e2dcca9a79f22f96658c33efe81936bc0d (patch) | |
tree | 3be1269fb186794d62e6f5b9d76c93b3b614c511 | |
parent | 09ac448a8eff73ffb7a3f683207802e8cb1f6d0b (diff) | |
download | rails-6259e4e2dcca9a79f22f96658c33efe81936bc0d.tar.gz rails-6259e4e2dcca9a79f22f96658c33efe81936bc0d.tar.bz2 rails-6259e4e2dcca9a79f22f96658c33efe81936bc0d.zip |
Use .to_s on _reflections lookup
-rw-r--r-- | activerecord/lib/active_record/associations.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/reflection.rb | 2 |
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. |