feat(routage): add routing_enabled to procedures

This commit is contained in:
Paul Chavard 2021-09-18 11:22:35 +02:00
parent 8b4bef2816
commit 0ff62c5a5e
3 changed files with 9 additions and 2 deletions

View file

@ -35,6 +35,7 @@
# path :string not null
# published_at :datetime
# routing_criteria_name :text default("Votre ville")
# routing_enabled :boolean
# test_started_at :datetime
# unpublished_at :datetime
# web_hook_url :string
@ -628,7 +629,7 @@ class Procedure < ApplicationRecord
end
def routee?
groupe_instructeurs.size > 1
routing_enabled? || groupe_instructeurs.size > 1
end
def defaut_groupe_instructeur_for_new_dossier

View file

@ -0,0 +1,5 @@
class AddRoutingEnabledToProcedures < ActiveRecord::Migration[6.1]
def change
add_column :procedures, :routing_enabled, :boolean
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2021_09_08_170019) do
ActiveRecord::Schema.define(version: 2021_09_15_170019) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -622,6 +622,7 @@ ActiveRecord::Schema.define(version: 2021_09_08_170019) do
t.text "api_particulier_scopes", default: [], array: true
t.jsonb "api_particulier_sources", default: {}
t.index ["api_particulier_sources"], name: "index_procedures_on_api_particulier_sources", using: :gin
t.boolean "routing_enabled"
t.index ["declarative_with_state"], name: "index_procedures_on_declarative_with_state"
t.index ["draft_revision_id"], name: "index_procedures_on_draft_revision_id"
t.index ["hidden_at"], name: "index_procedures_on_hidden_at"