module Lhm

Defines the same global namespace as LHM's gem does to mimic its API while providing a different behaviour. We delegate all LHM's methods to ActiveRecord so that you don't need to modify your old LHM migrations

Public Class Methods

change_table(table_name, _options = {}) { |adapter| ... } click to toggle source

Yields an adapter instance so that Lhm migration Dsl methods get delegated to ActiveRecord::Migration ones instead

@param table_name [String] @param _options [Hash] @param block [Block]

# File lib/lhm.rb, line 14
def self.change_table(table_name, _options = {}, &block)
  yield Adapter.new(@migration, table_name)
end
migration=(migration) click to toggle source

Sets the migration to apply the adapter to

@param migration [ActiveRecord::Migration]

# File lib/lhm.rb, line 21
def self.migration=(migration)
  @migration = migration
end