Skip to content

Commit

Permalink
fix: don't validate phone number uniqueness if nil
Browse files Browse the repository at this point in the history
  • Loading branch information
moustachu committed Jun 24, 2024
1 parent ff58323 commit db0416b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/decidim/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def self.all
validates :tos_agreement, acceptance: true, allow_nil: false, on: :create
validates :tos_agreement, acceptance: true, if: :user_invited?
validates :email, :nickname, uniqueness: { scope: :organization }, unless: -> { deleted? || managed? || nickname.blank? }
validates :phone_number, uniqueness: { scope: :phone_country }, unless: -> { new_record? }
validates :phone_number, uniqueness: { scope: :phone_country, allow_nil: true }, unless: -> { new_record? }

validate :all_roles_are_valid

Expand Down

0 comments on commit db0416b

Please sign in to comment.