From 95020a0c9bb2ef142870b767e1bc75310dd7ee20 Mon Sep 17 00:00:00 2001 From: barbara oliveira Date: Mon, 6 May 2024 16:22:13 +0200 Subject: [PATCH] feat:simple_proposal: Add a condition to the proposal_form_override.rb file for scopes & categories --- .../decidim/simple_proposal/proposal_form_override.rb | 4 ++-- yarn.lock | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 yarn.lock diff --git a/app/form/concerns/decidim/simple_proposal/proposal_form_override.rb b/app/form/concerns/decidim/simple_proposal/proposal_form_override.rb index 4eecbf5..071d755 100644 --- a/app/form/concerns/decidim/simple_proposal/proposal_form_override.rb +++ b/app/form/concerns/decidim/simple_proposal/proposal_form_override.rb @@ -15,8 +15,8 @@ module ProposalFormOverride validates :category_id, presence: true, if: ->(form) { form.require_category? } validates :scope_id, presence: true, if: ->(form) { form.require_scope? } - validate :check_category - validate :check_scope + validate :check_category, if: ->(form) { form.require_category? } + validate :check_scope, if: ->(form) { form.require_scope? } def map_model(model) super diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..fb57ccd --- /dev/null +++ b/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + +