]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user_role.rb
Make the image title match the feed title in diary rss
[rails.git] / app / models / user_role.rb
index c4d703530220bac59cc59f9f96b5db47e7213227..6bc7435aeaa6590e6421386ce7ac2c6c007488c3 100644 (file)
@@ -1,8 +1,7 @@
 class UserRole < ActiveRecord::Base
   belongs_to :user
 
-  ALL_ROLES = %w(administrator moderator)
+  ALL_ROLES = %w(administrator moderator).freeze
 
-  validates_inclusion_of :role, :in => ALL_ROLES
-  validates_uniqueness_of :role, :scope => :user_id
+  validates :role, :inclusion => ALL_ROLES, :uniqueness => { :scope => :user_id }
 end