Improve the formatting of the Procedure scopes
This commit is contained in:
parent
2f4f10683f
commit
c43f3fa415
1 changed files with 4 additions and 4 deletions
|
@ -32,11 +32,11 @@ class Procedure < ActiveRecord::Base
|
|||
mount_uploader :logo, ProcedureLogoUploader
|
||||
|
||||
default_scope { where(hidden_at: nil) }
|
||||
scope :brouillons, -> { where(published_at: nil).where(archived_at: nil) }
|
||||
scope :publiees, -> { where.not(published_at: nil).where(archived_at: nil) }
|
||||
scope :archivees, -> { where.not(archived_at: nil) }
|
||||
scope :brouillons, -> { where(published_at: nil).where(archived_at: nil) }
|
||||
scope :publiees, -> { where.not(published_at: nil).where(archived_at: nil) }
|
||||
scope :archivees, -> { where.not(archived_at: nil) }
|
||||
scope :publiee_ou_archivee, -> { where.not(published_at: nil) }
|
||||
scope :by_libelle, -> { order(libelle: :asc) }
|
||||
scope :by_libelle, -> { order(libelle: :asc) }
|
||||
|
||||
validates :libelle, presence: true, allow_blank: false, allow_nil: false
|
||||
validates :description, presence: true, allow_blank: false, allow_nil: false
|
||||
|
|
Loading…
Reference in a new issue