Add the archived scope to Procedure

This commit is contained in:
gregoirenovel 2017-07-10 16:52:59 +02:00
parent 411c5791c8
commit 6a381caaee
3 changed files with 3 additions and 2 deletions

View file

@ -15,7 +15,7 @@ class Admin::ProceduresController < AdminController
def archived
@procedures = smart_listing_create :procedures,
current_administrateur.procedures.where(archived: true).order(created_at: :desc),
current_administrateur.procedures.archived.order(created_at: :desc),
partial: "admin/procedures/list",
array: true

View file

@ -34,6 +34,7 @@ class Procedure < ActiveRecord::Base
default_scope { where(hidden_at: nil) }
scope :published, -> { where(published: true) }
scope :not_published, -> { where(published: false) }
scope :archived, -> { where(archived: true) }
scope :not_archived, -> { where(archived: false) }
scope :by_libelle, -> { order(libelle: :asc) }

View file

@ -25,7 +25,7 @@
.procedure-list-element{ class: @archived_class }
Archivées
.badge.progress-bar-purple
= current_administrateur.procedures.where(archived: true).count
= current_administrateur.procedures.archived.count
.split-hr-left