From 52297a255656c5e437237dd06cd365f69c30915b Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sat, 30 Dec 2023 00:17:16 -0300 Subject: [PATCH] cli: add 'pending_migrations?' shortcut --- .../twenty-cli/command/mixin/pending_migration_mixin.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/twenty-cli/lib/twenty-cli/command/mixin/pending_migration_mixin.rb b/twenty-cli/lib/twenty-cli/command/mixin/pending_migration_mixin.rb index 723961d..a06193c 100644 --- a/twenty-cli/lib/twenty-cli/command/mixin/pending_migration_mixin.rb +++ b/twenty-cli/lib/twenty-cli/command/mixin/pending_migration_mixin.rb @@ -1,6 +1,6 @@ module Twenty::Command::PendingMigrationMixin def run_command(...) - if Twenty::Migration.pending_migrations? + if pending_migrations? warn "There are pending migrations.\n" \ "Run \"twenty migrate\" first.\n" exit(1) @@ -8,4 +8,9 @@ module Twenty::Command::PendingMigrationMixin super(...) end end + private + + def pending_migrations? + Twenty::Migration.pending_migrations? + end end