Sha256: 1f924bf0e76e10111304faacbcec33ac5f1bf94f9ad8fe822812f6f590b91741

Contents?: true

Size: 765 Bytes

Versions: 23

Compression:

Stored size: 765 Bytes

Contents

require 'active_record/connection_adapters/abstract/schema_statements'

module Ridgepole
  module SchemaStatementsExt
    def index_name_exists?(table_name, column_name, options = {})
      if Ridgepole::ExecuteExpander.noop
        caller_methods = caller.map {|i| i =~ /:\d+:in `(.+)'/ ? $1 : '' }
        if caller_methods.any? {|i| i =~ /\Aremove_index/ }
          true
        elsif caller_methods.any? {|i| i =~ /\Aadd_index/ }
          false
        else
          super
        end
      else
        super
      end
    end

    def rename_table_indexes(table_name, new_name)
      # Nothing to do
    end
  end
end

module ActiveRecord
  module ConnectionAdapters
    class AbstractAdapter
      prepend Ridgepole::SchemaStatementsExt
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
ridgepole-0.6.6 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.6.beta3 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.6.beta2 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.6.beta lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.5 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.5.beta14 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.5.beta13 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.5.beta12 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.5.beta11 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.5.beta10 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.5.beta9 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.5.beta8 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.5.beta7 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.5.beta6 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.5.beta5 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.5.beta4 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.5.beta3 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.5.beta2 lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.5.beta lib/ridgepole/schema_statements_ext.rb
ridgepole-0.6.4 lib/ridgepole/schema_statements_ext.rb