Class: Faalis::User

Inherits:
Object
  • Object
show all
Includes:
Concerns::Authorizable, Concerns::User::AuthDefinitions, Concerns::User::Gravatar, Concerns::User::MongoidFields, Concerns::User::Permission, Concerns::User::UserRoles, Mongoid::Document, Mongoid::Timestamps
Defined in:
app/models/faalis/user.rb

Overview

User model for Faalis platform

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) policy_class



78
79
80
# File 'app/models/faalis/user.rb', line 78

def self.policy_class
  Faalis::UserPolicy
end

Instance Method Details

- (Object) join_guests

It's totally obviuse. Join the guest group if no group provided



69
70
71
72
73
74
75
76
# File 'app/models/faalis/user.rb', line 69

def join_guests
  #::Faalis::Group.find_by(role: 'guest')
  if groups.empty?
    guest_group = ::Faalis::Group.find_or_create_by(name: 'Guest',
                                                    role: 'guest')
    self.groups << guest_group
  end
end

- (Object) to_s



82
83
84
# File 'app/models/faalis/user.rb', line 82

def to_s
  full_name || email
end