X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/cbe707b33e87418b8576cbc3fbd23bcd032153cb..e3054fc15ac0fcc124700e80f44c1b9a180472d8:/app/models/issue.rb diff --git a/app/models/issue.rb b/app/models/issue.rb index 1fe078ad9..83923f242 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -37,7 +37,9 @@ class Issue < ActiveRecord::Base validates :reportable_id, :uniqueness => { :scope => [:reportable_type] } validates :reported_user_id, :presence => true - validates :assigned_role, :presence => true, :inclusion => %w[administrator moderator] + + ASSIGNED_ROLES = %w[administrator moderator].freeze + validates :assigned_role, :presence => true, :inclusion => ASSIGNED_ROLES before_validation :set_default_assigned_role before_validation :set_reported_user