Sha256: 006c1062e3aca933d21ed5f60790532627da73e044221ae3064e9b8d62e359f8

Contents?: true

Size: 744 Bytes

Versions: 74

Compression:

Stored size: 744 Bytes

Contents

# frozen_string_literal: true

# :reek:DuplicateMethodCall

def load_active_record
  # Configure active record
  active_record = YAML.safe_load(File.open('./spec/config/database.yml'))

  # Connect to database
  ActiveRecord::Base.establish_connection(active_record)
  migrate unless ActiveRecord::Base.connection.table_exists? 'janus_instances'
end

# :reek:UtilityFunction
def migrate
  ActiveRecord::Base.connection.create_table(:janus_instances) do |table|
    table.integer :session, limit: 8
    table.boolean :enable
    table.integer :thread, limit: 8
  end
end

# :reek:UtilityFunction
def load_mongo
  Mongoid.load!('./spec/config/mongoid.yml', :test)
end

def after_load_database
  DatabaseCleaner.clean
  create_janus_instances
end

Version data entries

74 entries across 74 versions & 1 rubygems

Version Path
ruby_rabbitmq_janus-3.0.0.pre.336 spec/config/database.rb
ruby_rabbitmq_janus-3.0.0.pre.335 spec/config/database.rb
ruby_rabbitmq_janus-3.0.0.pre.334 spec/config/database.rb
ruby_rabbitmq_janus-3.0.0.pre.330 spec/config/database.rb
ruby_rabbitmq_janus-3.0.0.pre.328 spec/config/database.rb
ruby_rabbitmq_janus-3.0.0.pre.327 spec/config/database.rb
ruby_rabbitmq_janus-2.7.2 spec/config/database.rb
ruby_rabbitmq_janus-2.7.2.pre.322 spec/config/database.rb
ruby_rabbitmq_janus-2.7.2.pre.320 spec/config/database.rb
ruby_rabbitmq_janus-2.7.2.pre.319 spec/config/database.rb
ruby_rabbitmq_janus-2.7.2.pre.318 spec/config/database.rb
ruby_rabbitmq_janus-2.7.2.pre.317 spec/config/database.rb
ruby_rabbitmq_janus-2.7.2.pre.316 spec/config/database.rb
ruby_rabbitmq_janus-2.7.2.pre.315 spec/config/database.rb
ruby_rabbitmq_janus-2.7.2.pre.314 spec/config/database.rb
ruby_rabbitmq_janus-2.7.2.pre.312 spec/config/database.rb
ruby_rabbitmq_janus-2.7.2.pre.310 spec/config/database.rb
ruby_rabbitmq_janus-2.7.2.pre.309 spec/config/database.rb
ruby_rabbitmq_janus-2.7.2.pre.308 spec/config/database.rb
ruby_rabbitmq_janus-2.7.2.pre.307 spec/config/database.rb