Add the not_published Procedure scope
This commit is contained in:
parent
811723e5fb
commit
31b23ac74e
3 changed files with 3 additions and 2 deletions
|
@ -26,7 +26,7 @@ class Admin::ProceduresController < AdminController
|
|||
|
||||
def draft
|
||||
@procedures = smart_listing_create :procedures,
|
||||
current_administrateur.procedures.where(published: false, archived: false).order(created_at: :desc),
|
||||
current_administrateur.procedures.not_published.where(archived: false).order(created_at: :desc),
|
||||
partial: "admin/procedures/list",
|
||||
array: true
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ class Procedure < ActiveRecord::Base
|
|||
|
||||
default_scope { where(hidden_at: nil) }
|
||||
scope :published, -> { where(published: true) }
|
||||
scope :not_published, -> { where(published: false) }
|
||||
scope :not_archived, -> { where(archived: false) }
|
||||
scope :by_libelle, -> { order(libelle: :asc) }
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
.procedure-list-element{ class: @draft_class }
|
||||
Brouillons
|
||||
.badge.progress-bar-default
|
||||
= current_administrateur.procedures.where(published: false, archived: false).count
|
||||
= current_administrateur.procedures.not_published.where(archived: false).count
|
||||
|
||||
%a#active-procedures{ :href => "#{url_for :admin_procedures}" }
|
||||
.procedure-list-element{ class: @active_class }
|
||||
|
|
Loading…
Add table
Reference in a new issue