Class: Workado::WorkspaceUser

Inherits:
ApplicationRecord show all
Extended by:
Enumerize
Defined in:
app/models/workado/workspace_user.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.accept!(token) ⇒ Object



16
17
18
19
20
# File 'app/models/workado/workspace_user.rb', line 16

def self.accept!(token)
  record = find_by(acceptable_token: token)
  record.accept!
  record
end

Instance Method Details

#acceptObject



30
31
32
# File 'app/models/workado/workspace_user.rb', line 30

def accept
  update(accepted_at: Time.current)
end

#accept!Object



26
27
28
# File 'app/models/workado/workspace_user.rb', line 26

def accept!
  update!(accepted_at: Time.current)
end

#accepted?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'app/models/workado/workspace_user.rb', line 22

def accepted?
  accepted_at.present?
end

#send_invitation_mailerObject



34
35
36
# File 'app/models/workado/workspace_user.rb', line 34

def send_invitation_mailer
  InviteMailer.invite(self).deliver_now
end