diff options
author | Eric Chahin <erc73@cornell.edu> | 2014-05-03 19:13:27 -0400 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2014-05-20 23:13:28 +0930 |
commit | 1f4daf15f8a60e9291afc2957aa57ae347490147 (patch) | |
tree | 58e6096b25fa7db7e5cee76e241b6dbee03f899a /activerecord/lib/active_record/associations/builder | |
parent | 528aff12888aaad131baab488fa1eabe6d2634fa (diff) | |
download | rails-1f4daf15f8a60e9291afc2957aa57ae347490147.tar.gz rails-1f4daf15f8a60e9291afc2957aa57ae347490147.tar.bz2 rails-1f4daf15f8a60e9291afc2957aa57ae347490147.zip |
Fixed the inferred table name for HABTM within a schema
Fixes #14824.
Diffstat (limited to 'activerecord/lib/active_record/associations/builder')
-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 44486ad758..30b11c01eb 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 @@ -11,7 +11,7 @@ module ActiveRecord::Associations::Builder end def join_table - @join_table ||= [@lhs_class.table_name, klass.table_name].sort.join("\0").gsub(/^(.*_)(.+)\0\1(.+)/, '\1\2_\3').gsub("\0", "_") + @join_table ||= [@lhs_class.table_name, klass.table_name].sort.join("\0").gsub(/^(.*[._])(.+)\0\1(.+)/, '\1\2_\3').gsub("\0", "_") end private |