Sha256: 6375e94b1c94d5a3442bdff7fc102adbd0d41e62847bf38dc5309d70a0e94489

Contents?: true

Size: 754 Bytes

Versions: 26

Compression:

Stored size: 754 Bytes

Contents

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

26 entries across 26 versions & 1 rubygems

Version Path
ridgepole-0.8.0.rc1 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.7 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.6 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.5 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.5.beta3 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.5.beta2 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.5.beta lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.4 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.3 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.3.beta3 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.3.beta2 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.3.beta lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.2 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.2.beta lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.1 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.1.beta5 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.1.beta4 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.1.beta3 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.1.beta2 lib/ridgepole/ext/abstract_adapter/disable_table_options.rb
ridgepole-0.7.1.beta lib/ridgepole/ext/abstract_adapter/disable_table_options.rb