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.79.1 spec/support/migration_helpers.rb
pact_broker-2.79.0 spec/support/migration_helpers.rb
pact_broker-2.78.1 spec/support/migration_helpers.rb
pact_broker-2.78.0 spec/support/migration_helpers.rb
pact_broker-2.77.0 spec/support/migration_helpers.rb
pact_broker-2.76.2 spec/support/migration_helpers.rb
pact_broker-2.76.1 spec/support/migration_helpers.rb
pact_broker-2.76.0 spec/support/migration_helpers.rb
pact_broker-2.75.0 spec/support/migration_helpers.rb
pact_broker-2.74.1 spec/support/migration_helpers.rb
pact_broker-2.74.0 spec/support/migration_helpers.rb
pact_broker-2.73.0 spec/support/migration_helpers.rb
pact_broker-2.72.0 spec/support/migration_helpers.rb
pact_broker-2.71.0 spec/support/migration_helpers.rb
pact_broker-2.70.0 spec/support/migration_helpers.rb
pact_broker-2.69.0 spec/support/migration_helpers.rb
pact_broker-2.68.1 spec/support/migration_helpers.rb
pact_broker-2.68.0 spec/support/migration_helpers.rb
pact_broker-2.67.0 spec/support/migration_helpers.rb
pact_broker-2.66.0 spec/support/migration_helpers.rb