]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user_role.rb
Fix style issues found by new rubocop version
[rails.git] / app / models / user_role.rb
index fb783281ed81dfa10cd5098d7c861bdc432f5455..9686f7250bdc7234173dad784686811420422594 100644 (file)
@@ -1,8 +1,7 @@
 class UserRole < ActiveRecord::Base
   belongs_to :user
 
-  ALL_ROLES = ['administrator', 'moderator']
+  ALL_ROLES = %w(administrator moderator)
 
-  validates_inclusion_of :role, :in => ALL_ROLES
-  validates_uniqueness_of :role, :scope => :user_id
+  validates :role, :inclusion => ALL_ROLES, :uniqueness => { :scope => :user_id }
 end