Class: User

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/forge/app/models/user.rb

Instance Method Summary collapse

Instance Method Details

#apply_member_roleObject



23
24
25
# File 'lib/forge/app/models/user.rb', line 23

def apply_member_role
  self.roles << Role.find_by_title("Member") if self.roles.blank?
end

#member?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/forge/app/models/user.rb', line 32

def member?
  is_member?
end

#staff?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/forge/app/models/user.rb', line 36

def staff?
  is_super_admin? || is_admin? || is_contributor?
end