method
legacy_index_name
v7.1.3.2 -
Show latest stable
- Class:
ActiveRecord::Migration::Compatibility::V7_0::LegacyIndexName
legacy_index_name(table_name, options)private
No documentation available.
# File activerecord/lib/active_record/migration/compatibility.rb, line 38
def legacy_index_name(table_name, options)
if Hash === options
if options[:column]
"index_#{table_name}_on_#{Array(options[:column]) * '_and_'}"
elsif options[:name]
options[:name]
else
raise ArgumentError, "You must specify the index name"
end
else
legacy_index_name(table_name, index_name_options(options))
end
end