Init model (when neccessary)

This commit is contained in:
0x1eef 2024-04-27 02:44:52 -03:00
parent 47aaecc483
commit e24f7a0690
4 changed files with 4 additions and 0 deletions

View file

@ -21,6 +21,7 @@ class Twenty::Command::Connect < Twenty::Command
private
def run_command(options)
require "twenty/server/model"
path = File.realpath(options.path ? options.path : Dir.getwd)
if File.exist?(path)
project = Twenty::Project.create(

View file

@ -24,6 +24,7 @@ class Twenty::Command::Console < Twenty::Command
private
def run_command(options)
require "twenty/server/model"
require "irb"
TOPLEVEL_BINDING.irb
end

View file

@ -19,6 +19,7 @@ class Twenty::Command::Disconnect < Twenty::Command
private
def run_command(options)
require "twenty/server/model"
path = File.realpath(options.path ? options.path : Dir.getwd)
Twenty::Project
.where(path:)

View file

@ -36,6 +36,7 @@ class Twenty::Command::Up < Twenty::Command
private
def run_command(options)
require "twenty/server/model"
File.binwrite(pid, Process.pid.to_s)
thr = Twenty::Rack.server(options).start
thr.join