Class: Masks::Access::ActorPassword

Inherits:
Object
  • Object
show all
Includes:
Masks::Access
Defined in:
app/models/masks/access/actor_password.rb

Overview

Access class for actor.password

This access class can change that actor’s password.

Instance Method Summary collapse

Instance Method Details

#change_password(password, **opts) ⇒ Object



13
14
15
16
17
18
# File 'app/models/masks/access/actor_password.rb', line 13

def change_password(password, **opts)
  actor = opts[:actor] || self.actor
  actor.changed_password_at = Time.current
  actor.password = password
  actor.save if actor.valid?
end