diff --git a/app/models/user_group.rb b/app/models/user_group.rb index d274fe71a..a9a81882b 100644 --- a/app/models/user_group.rb +++ b/app/models/user_group.rb @@ -41,9 +41,7 @@ class UserGroup < ApplicationRecord enum stats_visibility: STATS_VISIBILITY_LEVELS validate do - if @invalid_stats_visibility - errors.add(:stats_visibility, "Not stats_visibility type, please select from the list: #{STATS_VISIBILITY_LEVELS.keys}") - end + errors.add(:stats_visibility, "Not valid stats_visibility type, please select from the list: #{STATS_VISIBILITY_LEVELS.keys}") if @invalid_stats_visibility end validates :display_name, presence: true