Module: ActiveRecord::SimpleIndexName::ActiveRecordExt_7_1::SchemaStatements

Defined in:
lib/active_record/simple_index_name/active_record_ext_7_1.rb

Instance Method Summary collapse

Instance Method Details

#generate_index_name(table_name, column) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/active_record/simple_index_name/active_record_ext_7_1.rb', line 5

def generate_index_name(table_name, column)
  if ActiveRecord::SimpleIndexName.current_shorten?
    Array.wrap(column) * "_and_"
  else
    super
  end
end

#rename_index(table_name, old_name, new_name) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/active_record/simple_index_name/active_record_ext_7_1.rb', line 13

def rename_index(table_name, old_name, new_name)
  if ActiveRecord::SimpleIndexName.current_shorten? && old_name == new_name
    # nop
  else
    super
  end
end