Module: Workit::Model
- Defined in:
- lib/workit/model.rb,
lib/workit/model/span.rb,
lib/workit/model/task.rb
Defined Under Namespace
Class Method Summary collapse
Class Method Details
.get_sqlite_db ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/workit/model.rb', line 11 def self.get_sqlite_db if ENV['WORKIT_ENV'] == 'test' "/tmp/workit_test.db" else File.(File.join(ENV['HOME'], '.workit', 'database.db')) end end |
.setup ⇒ Object
19 20 21 22 23 24 |
# File 'lib/workit/model.rb', line 19 def self.setup FileUtils.mkdir_p(File.dirname(get_sqlite_db)) DataMapper.setup(:default, "sqlite://#{get_sqlite_db}") DataMapper.finalize DataMapper.auto_upgrade! end |