Skip to content

Commit

Permalink
feat:simple_proposal: Add a condition to the proposal_form_override.r…
Browse files Browse the repository at this point in the history
…b file for scopes & categories
  • Loading branch information
BarbaraOliveira13 committed May 6, 2024
1 parent d3244d3 commit 95020a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


0 comments on commit 95020a0

Please sign in to comment.