1 class User < ActiveRecord::Base
2 # Include default devise modules. Others available are:
3 # :token_authenticatable, :confirmable, :lockable and :timeoutable
4 devise :database_authenticatable, :registerable,
5 :recoverable, :rememberable, :trackable, :validatable,
6 :token_authenticatable, :lockable,:timeoutable, :invitable
8 # Setup accessible (or protected) attributes for your model
9 attr_accessible :email, :password, :password_confirmation, :remember_me
12 has_many :roles, :through => :assignments
16 role.name.underscore.to_sym