Sha256: 816dec17a2efece0f446867b95fe9077f955872817e827b471095d278841f79f

Contents?: true

Size: 785 Bytes

Versions: 16

Compression:

Stored size: 785 Bytes

Contents

# frozen_string_literal: true

require 'active_record/connection_adapters/abstract_adapter'

module Ridgepole
  module Ext
    module AbstractAdapter
      module DisableTableOptions
        def without_table_options(value)
          @__without_table_options = value
          yield
        ensure
          remove_instance_variable(:@__without_table_options)
        end

        def table_options(table_name)
          options = super
          options.delete(:options) if options && @__without_table_options
          options
        end
      end
    end
  end
end

module ActiveRecord
  module ConnectionAdapters
    class AbstractAdapter
      def self.inherited(subclass)
        subclass.prepend Ridgepole::Ext::AbstractAdapter::DisableTableOptions
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ridgepole-0.8.13 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.8.12 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.8.11 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.8.10 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.8.9 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.8.8 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.8.7 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.8.6 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.8.5 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.8.4 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.8.3 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.8.2 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.8.1 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.8.0 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.8.0.rc2 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.8 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb