Fix rubocop

This commit is contained in:
Martin Lensment 2015-01-21 11:10:59 +02:00
parent a4ebb24a03
commit 5ed983fd2e
4 changed files with 5 additions and 6 deletions

View file

@ -7,9 +7,9 @@ class Ability
@user = user || User.new
@user.roles.each { |role| send(role) } if @user.roles
if @user.roles.nil? || @user.roles.empty?
can :show, :dashboard
end
return if @user.roles || @user.roles.any?
can :show, :dashboard
end
def user

View file

@ -15,7 +15,7 @@ class User < ActiveRecord::Base
validate :validate_identity_code
ROLES = ['user', 'customer_service', 'admin']
ROLES = %w(user customer_service admin)
def to_s
username