Sha256: 267061c0f4afa4fbbb3e1c1b6abbef7f3d092600d7011466bf0554932b4259b6

Contents?: true

Size: 406 Bytes

Versions: 69

Compression:

Stored size: 406 Bytes

Contents

require 'tasks/database'

module MigrationHelpers
  def create table_name, params, id_column_name = :id
    database[table_name].insert(params);
    database[table_name].order(id_column_name).last if id_column_name
  end

  def clean table_name
    database[table_name].delete rescue puts "Error cleaning #{table_name} #{$!}"
  end

  def database
    @database ||= PactBroker::Database.database
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
pact_broker-2.52.1 spec/support/migration_helpers.rb
pact_broker-2.52.0 spec/support/migration_helpers.rb
pact_broker-2.51.0 spec/support/migration_helpers.rb
pact_broker-2.50.1 spec/support/migration_helpers.rb
pact_broker-2.50.0 spec/support/migration_helpers.rb
pact_broker-2.49.0 spec/support/migration_helpers.rb
pact_broker-2.48.0 spec/support/migration_helpers.rb
pact_broker-2.47.1 spec/support/migration_helpers.rb
pact_broker-2.47.0 spec/support/migration_helpers.rb
pact_broker-2.46.0 spec/support/migration_helpers.rb
pact_broker-2.45.0 spec/support/migration_helpers.rb
pact_broker-2.44.0 spec/support/migration_helpers.rb
pact_broker-2.43.0 spec/support/migration_helpers.rb
pact_broker-2.42.0 spec/support/migration_helpers.rb
pact_broker-2.41.0 spec/support/migration_helpers.rb
pact_broker-2.40.0 spec/support/migration_helpers.rb
pact_broker-2.39.0 spec/support/migration_helpers.rb
pact_broker-2.38.1 spec/support/migration_helpers.rb
pact_broker-2.38.0 spec/support/migration_helpers.rb
pact_broker-2.37.0 spec/support/migration_helpers.rb