instance method proper_table_name

Ruby on Rails 7.0.10

Since v4.1.16

Available in: v4.1.16 v4.2.9 v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

proper_table_name(name, options = {})

Finds the correct table name given an Active Record object. Uses the Active Record object’s own table_name, or pre/suffix from the options passed in.

Parameters

name req
options opt = {}
Source
# File activerecord/lib/active_record/migration.rb, line 1028
    def proper_table_name(name, options = {})
      if name.respond_to? :table_name
        name.table_name
      else
        "#{options[:table_name_prefix]}#{name}#{options[:table_name_suffix]}"
      end
    end

Defined in activerecord/lib/active_record/migration.rb line 1028 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Migration

Type at least 2 characters to search.

↑↓ navigate · open · esc close