Refactor roles

This commit is contained in:
Martin Lensment 2015-01-20 17:49:14 +02:00
parent b527221baf
commit b0eb6798b0
16 changed files with 155 additions and 223 deletions

View file

@ -6,7 +6,6 @@ class User < ActiveRecord::Base
# After activisation, system should require to change temp password.
# TODO: Estonian id validation
belongs_to :role
belongs_to :country
validates :username, :password, presence: true
@ -16,6 +15,8 @@ class User < ActiveRecord::Base
validate :validate_identity_code
ROLES = ['user', 'customer_service', 'admin']
def to_s
username
end