Sha256: 4a8a078971d2c3afb0b3a698b876d08933a65543858b8103d4692b9d410544f0
Contents?: true
Size: 504 Bytes
Versions: 18
Compression:
Stored size: 504 Bytes
Contents
class User < ActiveRecord::Base belongs_to :role before_create :add_user_role # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable def name "#{first_name} #{last_name}" end def role_symbols [role.title.to_sym] end private def add_user_role self.role = Role.find_by_title 'user' end end
Version data entries
18 entries across 18 versions & 1 rubygems