Sha256: 032f227f3125bdf838574f098d6508fac79e1cf33d217526704612a2ae32741a

Contents?: true

Size: 412 Bytes

Versions: 7

Compression:

Stored size: 412 Bytes

Contents

module SchemaPlus::Indexes
  module ActiveRecord
    module Migration
      module CommandRecorder

        # inversion of add_index will be remove_index.  add if_exists
        # option for cases where the index doesn't actually exist
        def invert_add_index(args)
          super.tap { |(command, (arg, options))|
            options[:if_exists] = true
          }
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
schema_plus_indexes-0.3.1 lib/schema_plus/indexes/active_record/migration/command_recorder.rb
schema_plus_indexes-0.3.0 lib/schema_plus/indexes/active_record/migration/command_recorder.rb
schema_plus_indexes-0.2.4 lib/schema_plus/indexes/active_record/migration/command_recorder.rb
schema_plus_indexes-0.2.3 lib/schema_plus/indexes/active_record/migration/command_recorder.rb
schema_plus_indexes-0.2.2 lib/schema_plus/indexes/active_record/migration/command_recorder.rb
schema_plus_indexes-0.2.1 lib/schema_plus/indexes/active_record/migration/command_recorder.rb
schema_plus_indexes-0.2.0 lib/schema_plus/indexes/active_record/migration/command_recorder.rb