Module: Ridgepole::SchemaStatementsExt

Included in:
ActiveRecord::ConnectionAdapters::AbstractAdapter
Defined in:
lib/ridgepole/schema_statements_ext.rb

Instance Method Summary collapse

Instance Method Details

#index_name_exists?Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/ridgepole/schema_statements_ext.rb', line 7

def index_name_exists?(*)
  if Ridgepole::ExecuteExpander.noop
    caller_methods = caller.map { |i| i =~ /:\d+:in `(.+)'/ ? Regexp.last_match(1) : '' }
    if caller_methods.any? { |i| i.start_with?('remove_index') }
      true
    elsif caller_methods.any? { |i| i.start_with?('add_index') }
      false
    else
      super
    end
  else
    super
  end
end

#rename_table_indexesObject



22
23
24
# File 'lib/ridgepole/schema_statements_ext.rb', line 22

def rename_table_indexes(*)
  # Nothing to do
end