aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/migration/join_table.rb
blob: ebf64cbcdcac285ba986a0ac75d962b35a0b2ca3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module ActiveRecord
  class Migration
    module JoinTable #:nodoc:
      private

      def find_join_table_name(table_1, table_2, options = {})
        options.delete(:table_name) || join_table_name(table_1, table_2)
      end

      def join_table_name(table_1, table_2)
        [table_1.to_s, table_2.to_s].sort.join("_").to_sym
      end
    end
  end
end