Sha256: ca91c43b01475c24cf98e7614993f21347d20ec0ce5373398d4738f4e4a5eeeb

Contents?: true

Size: 785 Bytes

Versions: 11

Compression:

Stored size: 785 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) # rubocop:disable Lint/UnusedMethodArgument
    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

11 entries across 11 versions & 3 rubygems

Version Path
departure-6.7.0 lib/lhm.rb
departure-6.6.0 lib/lhm.rb
departure-6.5.0 lib/lhm.rb
departure-6.4.0 lib/lhm.rb
departure-6.3.0 lib/lhm.rb
departure-76c9880-6.2.0 lib/lhm.rb
departure-6.2.0 lib/lhm.rb
arrival-0.1.0 lib/lhm.rb
departure-6.1.0 lib/lhm.rb
departure-6.0.0 lib/lhm.rb
departure-5.0.0 lib/lhm.rb