From b56706b6b83301624468e53041349a1d0e41cae8 Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Tue, 14 Jun 2022 13:04:36 +0200 Subject: [PATCH] add scope publiques for procedures --- app/models/procedure.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index e36a929c4..7f01dadcb 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -219,6 +219,7 @@ class Procedure < ApplicationRecord scope :brouillons, -> { where(aasm_state: :brouillon) } scope :publiees, -> { where(aasm_state: :publiee) } scope :closes, -> { where(aasm_state: [:close, :depubliee]) } + scope :publiques, -> { where(opendata: true) } scope :publiees_ou_closes, -> { where(aasm_state: [:publiee, :close, :depubliee]) } scope :by_libelle, -> { order(libelle: :asc) } scope :created_during, -> (range) { where(created_at: range) }