Added edit and cancel button

This commit is contained in:
2024-08-04 13:26:31 +02:00
parent ed0c4408ca
commit 54e0cd5e45
5 changed files with 41 additions and 10 deletions

View File

@@ -62,6 +62,16 @@ class Job < ApplicationRecord
errors.add(:pdf, 'must be a PDF')
end
def able_to_cancel?
open?
end
# cancel job only if it is still open
def canceled!
self.status = :canceled if open?
save
end
private
def update_printed_at