Added edit and cancel button
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user