Sha256: a89e3a31c3885fd3ce70855083df79644bbc7c60d0249df15817fa11b880759b
Contents?: true
Size: 622 Bytes
Versions: 7
Compression:
Stored size: 622 Bytes
Contents
# frozen_string_literal: true module Decidim # Decidim command updates user's password class UpdatePassword < Decidim::Command # Updates a user's password. # # user - The user to be updated. # form - The form with the data. def initialize(user, form) @user = user @form = form end def call return broadcast(:invalid) if form.invalid? user.password = form.password user.password_updated_at = Time.current if user.save broadcast(:ok) else broadcast(:invalid) end end private attr_reader :form, :user end end
Version data entries
7 entries across 7 versions & 1 rubygems