method
index_name_for
v7.0.0 -
Show latest stable
- Class:
ActiveRecord::Generators::MigrationGenerator
index_name_for(attribute)private
No documentation available.
# File activerecord/lib/rails/generators/active_record/migration/migration_generator.rb, line 51
def index_name_for(attribute)
if attribute.foreign_key?
attribute.name
else
attribute.name.singularize.foreign_key
end.to_sym
end