Module: Twenty
- Extended by:
- FileUtils
- Defined in:
- lib/twenty-backend.rb
Defined Under Namespace
Modules: ColorableMixin, GraphQL, Migration Classes: Model, Project, Servlet, Task
Class Method Summary collapse
-
.data_dir ⇒ String
Returns the directory where twenty stores data.
-
.default_database ⇒ String
Returns the location of the default SQLite database.
-
.establish_connection(path:) ⇒ void
Establishes a database connection.
Class Method Details
.data_dir ⇒ String
Returns the directory where twenty stores data.
16 17 18 |
# File 'lib/twenty-backend.rb', line 16 def self.data_dir File.join(Dir.home, ".local", "share", "20") end |
.default_database ⇒ String
Returns the location of the default SQLite database.
23 24 25 |
# File 'lib/twenty-backend.rb', line 23 def self.default_database @default_database ||= File.join(data_dir, "database.sqlite") end |
.establish_connection(path:) ⇒ void
This method returns an undefined value.
Establishes a database connection.
34 35 36 37 38 39 40 |
# File 'lib/twenty-backend.rb', line 34 def self.establish_connection(path:) ActiveRecord::Base.establish_connection( adapter: "sqlite3", database: path, pool: 16 ) end |