Sha256: 198a043fa29d9bee6ca6f8585993c7726d8cd371c5b4d33e37cf02205c6d5c10

Contents?: true

Size: 602 Bytes

Versions: 1

Compression:

Stored size: 602 Bytes

Contents

# frozen_string_literal: true

module Account
  class ProfilePasswordForm < ApplicationForm
    attribute :current_password, String
    attribute :password, String
    attribute :password_confirmation, String

    validates :current_password, presence: true, length: { minimum: 6, maximum: 128 }
    validates :password, presence: true, length: { minimum: 6, maximum: 128 }, confirmation: true

    def submit
      return false unless valid?

      api_answer = TranslationCms::Api::Customer.update_password(customer: attributes)
      merge_responce! api_answer
      errors.empty?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
translation_cms-0.1.5 app/forms/account/profile_password_form.rb