Class: Timingapp::Database
- Inherits:
-
Object
- Object
- Timingapp::Database
- Includes:
- Singleton
- Defined in:
- lib/timingapp/database.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
11 12 13 |
# File 'lib/timingapp/database.rb', line 11 def connection @connection end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
11 12 13 |
# File 'lib/timingapp/database.rb', line 11 def path @path end |
Instance Method Details
#open(path) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/timingapp/database.rb', line 13 def open(path) @path = path @connection = ActiveRecord::Base.establish_connection( adapter: "sqlite3", database: path, flags: SQLite3::Constants::Open::READONLY ) end |