method

table_name

Importance_0
v7.1.3.2 - Show latest stable - 0 notes - Class: HasAndBelongsToMany
table_name() private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb, line 80
      def table_name
        if options[:join_table]
          options[:join_table].to_s
        else
          class_name = options.fetch(:class_name) {
            association_name.to_s.camelize.singularize
          }
          klass = lhs_model.send(:compute_type, class_name.to_s)
          [lhs_model.table_name, klass.table_name].sort.join("\00"").gsub(/^(.*[._])(.+)\00\\11((.+)/, '\1\2_\3').tr("\00"", "_")
        end
      end
Register or log in to add new notes.