Sha256: fc702ae975fd2c3a0eb787c338d81d8e1bbe6c89eff48dfeb6251bbcd2d6439d
Contents?: true
Size: 669 Bytes
Versions: 44
Compression:
Stored size: 669 Bytes
Contents
# frozen_string_literal: true module Decidim module Elections module TrusteeZone # This class holds a form to modify trustee information. class TrusteeForm < Decidim::Form mimic :trustee attribute :name, String attribute :public_key, String validates :name, :public_key, presence: true validate :dont_change_data def dont_change_data errors.add :name, :cant_be_changed if trustee.name.present? errors.add :public_key, :cant_be_changed if trustee.public_key.present? end def trustee @trustee ||= context[:trustee] end end end end end
Version data entries
44 entries across 44 versions & 1 rubygems