Class: PriorityTest::Gateway::Sequel
- Inherits:
-
Object
- Object
- PriorityTest::Gateway::Sequel
- Defined in:
- lib/priority_test/gateway/sequel.rb
Class Attribute Summary collapse
-
.database ⇒ Object
readonly
Returns the value of attribute database.
Class Method Summary collapse
Class Attribute Details
.database ⇒ Object (readonly)
Returns the value of attribute database.
8 9 10 |
# File 'lib/priority_test/gateway/sequel.rb', line 8 def database @database end |
Class Method Details
.run_migration(database) ⇒ Object
22 23 24 |
# File 'lib/priority_test/gateway/sequel.rb', line 22 def self.run_migration(database) ::Sequel::Migrator.apply(database, migrations_dir) end |
.setup ⇒ Object
11 12 13 14 15 |
# File 'lib/priority_test/gateway/sequel.rb', line 11 def self.setup ::Sequel.database_timezone = :utc @database ||= ::Sequel.connect(PriorityTest.configuration.database) run_migration(database) end |
.teardown ⇒ Object
17 18 19 20 |
# File 'lib/priority_test/gateway/sequel.rb', line 17 def self.teardown @database.disconnect if @database @database = nil end |