Sha256: 43df388dd4637d02658fc153f26ce4bc5a8378fd1a95b4e0962c4c569007fd43
Contents?: true
Size: 607 Bytes
Versions: 73
Compression:
Stored size: 607 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: passport_number, postal_code: 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
73 entries across 73 versions & 2 rubygems