Sha256: 3bf5b06868b8259ab536a6328b15873aa65f7d49c35baf2075295efca57ee642
Contents?: true
Size: 579 Bytes
Versions: 13
Compression:
Stored size: 579 Bytes
Contents
# frozen_string_literal: true # An example implementation of an AuthorizationHandler to be used in tests. class AnotherDummyAuthorizationHandler < Decidim::AuthorizationHandler attribute :passport_number, String attribute :postal_code, String validates :passport_number, presence: true validate :valid_passport_number def metadata super.merge(passport_number:, postal_code:) end def unique_id passport_number end private def valid_passport_number errors.add(:passport_number, :invalid) unless passport_number.to_s.start_with?("A") end end
Version data entries
13 entries across 13 versions & 1 rubygems