Sha256: 97ce761cc8ab984cb9cc7b3d3716ad98a617bd8bec393a2cc998e78f34959cc5

Contents?: true

Size: 406 Bytes

Versions: 12

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

12 entries across 12 versions & 1 rubygems

Version Path
pact_broker-2.89.1 spec/support/migration_helpers.rb
pact_broker-2.89.0 spec/support/migration_helpers.rb
pact_broker-2.88.0 spec/support/migration_helpers.rb
pact_broker-2.87.0 spec/support/migration_helpers.rb
pact_broker-2.86.0 spec/support/migration_helpers.rb
pact_broker-2.85.1 spec/support/migration_helpers.rb
pact_broker-2.85.0 spec/support/migration_helpers.rb
pact_broker-2.84.0 spec/support/migration_helpers.rb
pact_broker-2.83.0 spec/support/migration_helpers.rb
pact_broker-2.82.0 spec/support/migration_helpers.rb
pact_broker-2.81.0 spec/support/migration_helpers.rb
pact_broker-2.80.0 spec/support/migration_helpers.rb