Sha256: ebfc6c0b1c07be447d9869f1fd1a0971f38b134fd22c6378409deca28db8437e

Contents?: true

Size: 387 Bytes

Versions: 17

Compression:

Stored size: 387 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
  end

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

  def database
    @database ||= DB.connection_for_env 'test'
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
pact_broker-2.15.0 spec/support/migration_helpers.rb
pact_broker-2.14.0 spec/support/migration_helpers.rb
pact_broker-2.13.1 spec/support/migration_helpers.rb
pact_broker-2.13.0 spec/support/migration_helpers.rb
pact_broker-2.12.0 spec/support/migration_helpers.rb
pact_broker-2.11.0 spec/support/migration_helpers.rb
pact_broker-2.10.0 spec/support/migration_helpers.rb
pact_broker-2.9.0 spec/support/migration_helpers.rb
pact_broker-2.9.0.beta.5 spec/support/migration_helpers.rb
pact_broker-2.8.0.beta.5 spec/support/migration_helpers.rb
pact_broker-2.8.0.beta.4 spec/support/migration_helpers.rb
pact_broker-2.7.0.beta.3 spec/support/migration_helpers.rb
pact_broker-2.7.0.beta.2 spec/support/migration_helpers.rb
pact_broker-2.7.0.beta.1 spec/support/migration_helpers.rb
pact_broker-2.6.0 spec/support/migration_helpers.rb
pact_broker-2.5.1 spec/support/migration_helpers.rb
pact_broker-2.5.0 spec/support/migration_helpers.rb