diff options
author | Sammy Larbi <sam@codeodor.com> | 2014-10-08 15:58:11 -0500 |
---|---|---|
committer | Sammy Larbi <sam@codeodor.com> | 2014-11-09 11:56:07 -0600 |
commit | f43f56e16e99dae083cf1400a48c236d1af265d4 (patch) | |
tree | f9d346387343f2c4b5241d2d7296993cbb47ed43 /activerecord/lib/active_record/associations | |
parent | 47704af54d51b240f733c596ebb39a033aa698cd (diff) | |
download | rails-f43f56e16e99dae083cf1400a48c236d1af265d4.tar.gz rails-f43f56e16e99dae083cf1400a48c236d1af265d4.tar.bz2 rails-f43f56e16e99dae083cf1400a48c236d1af265d4.zip |
Ensure HABTM relationships produce valid class names (Fixes #17119)
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb b/activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb index 815e8eb97f..357b28ac94 100644 --- a/activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb +++ b/activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb @@ -98,7 +98,7 @@ module ActiveRecord::Associations::Builder def middle_options(join_model) middle_options = {} - middle_options[:class] = join_model + middle_options[:class_name] = "#{lhs_model.name}::#{join_model.name}" middle_options[:source] = join_model.left_reflection.name if options.key? :foreign_key middle_options[:foreign_key] = options[:foreign_key] |