Add Procedure#brouillon?
This commit is contained in:
parent
25800305ad
commit
36bee67085
3 changed files with 15 additions and 1 deletions
|
@ -120,6 +120,10 @@ class Procedure < ActiveRecord::Base
|
|||
return procedure if procedure.save
|
||||
end
|
||||
|
||||
def brouillon?
|
||||
published_at.nil?
|
||||
end
|
||||
|
||||
def publish!(path)
|
||||
self.update_attributes!({ published_at: Time.now, archived_at: nil })
|
||||
ProcedurePath.create!(path: path, procedure: self, administrateur: self.administrateur)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue