Skip to content

Instantly share code, notes, and snippets.

@mt9304

mt9304/user.rb Secret

Created Oct 8, 2018
Embed
What would you like to do?
class User < ApplicationRecord
rolify
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
def admin?
has_role?(:admin)
end
def normal_user?
has_role?(:normal_user)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment