Skip to content

Commit

Permalink
refactoring identifier validation rules
Browse files Browse the repository at this point in the history
  • Loading branch information
brujeo committed Sep 28, 2023
1 parent c5d507b commit 0b39cc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/pafs_core/area.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class Area < ApplicationRecord

validates :name, :area_type, presence: true
validates :name, uniqueness: true
validates :identifier, presence: true, if: :rma? || :authority?, unless: :skip_identifier_validation
validates :identifier, uniqueness: true, if: :rma? || :authority?, unless: :skip_identifier_validation
validates :identifier, presence: true, if: -> { rma? || authority? }, unless: :skip_identifier_validation
validates :identifier, uniqueness: true, if: -> { rma? || authority? }, unless: :skip_identifier_validation
validate :parentage
validates :area_type, inclusion: { in: AREA_TYPES }
validates :sub_type, presence: true, if: :rma?
Expand Down

0 comments on commit 0b39cc1

Please sign in to comment.