Sha256: 74d80052004ebf364df790b8b8f81df526ff191f0a70eba3da4c9b9c890fae18

Contents?: true

Size: 743 Bytes

Versions: 19

Compression:

Stored size: 743 Bytes

Contents

require 'lhm/adapter'

# 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
module Lhm

  # 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]
  def self.change_table(table_name, _options = {}, &block)
    yield Adapter.new(@migration, table_name)
  end

  # Sets the migration to apply the adapter to
  #
  # @param migration [ActiveRecord::Migration]
  def self.migration=(migration)
    @migration = migration
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
departure-4.0.1 lib/lhm.rb
departure-4.0.0 lib/lhm.rb
departure-2.0.1 lib/lhm.rb
departure-3.0.1 lib/lhm.rb
departure-3.0.0 lib/lhm.rb
departure-2.0.0 lib/lhm.rb
departure-1.0.1 lib/lhm.rb
departure-1.0.0 lib/lhm.rb
percona_migrator-3.0.0 lib/lhm.rb
percona_migrator-1.1.0 lib/lhm.rb
percona_migrator-0.1.1 lib/lhm.rb
percona_migrator-1.0.0 lib/lhm.rb
percona_migrator-0.1.0.rc.7 lib/lhm.rb
percona_migrator-0.1.0.rc.6 lib/lhm.rb
percona_migrator-0.1.0.rc.5 lib/lhm.rb
percona_migrator-0.1.0.rc.4 lib/lhm.rb
percona_migrator-0.1.0.rc.3 lib/lhm.rb
percona_migrator-0.1.0.rc.2 lib/lhm.rb
percona_migrator-0.1.0.rc.1 lib/lhm.rb