cli: add 'pending_migrations?' shortcut

This commit is contained in:
0x1eef 2023-12-30 00:17:16 -03:00
parent 4e483ccf17
commit 52297a2556

View file

@ -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