From 2f4f10683f0d6a263c3f87c30e5dcf8a9c25175f Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Tue, 11 Jul 2017 15:56:43 +0200 Subject: [PATCH] Delete now unused scopes on Procedure --- app/models/procedure.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index a31f7d9b4..06c283030 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -32,13 +32,10 @@ class Procedure < ActiveRecord::Base mount_uploader :logo, ProcedureLogoUploader default_scope { where(hidden_at: nil) } - scope :brouillons, -> { not_published.not_archived } + scope :brouillons, -> { where(published_at: nil).where(archived_at: nil) } scope :publiees, -> { where.not(published_at: nil).where(archived_at: nil) } - scope :archivees, -> { archived } + scope :archivees, -> { where.not(archived_at: nil) } scope :publiee_ou_archivee, -> { where.not(published_at: nil) } - scope :not_published, -> { where(published_at: nil) } - scope :archived, -> { where.not(archived_at: nil) } - scope :not_archived, -> { where(archived_at: nil) } scope :by_libelle, -> { order(libelle: :asc) } validates :libelle, presence: true, allow_blank: false, allow_nil: false