File tree Expand file tree Collapse file tree
lib/decidim/verifications Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ module Decidim
4+ # An example implementation of an AuthorizationHandler to be used in tests.
5+ class AnotherDummyAuthorizationHandler < AuthorizationHandler
6+ attribute :passport_number , String
7+
8+ validates :passport_number , presence : true
9+ validate :valid_passport_number
10+
11+ def unique_id
12+ passport_number
13+ end
14+
15+ private
16+
17+ def valid_passport_number
18+ errors . add ( :passport_number , :invalid ) unless passport_number . start_with? ( "A" )
19+ end
20+ end
21+ end
Original file line number Diff line number Diff line change 55 workflow . action_authorizer = "Decidim::DummyAuthorizationHandler::ActionAuthorizer"
66 workflow . expires_in = 1 . hour
77end
8+
9+ Decidim ::Verifications . register_workflow ( :another_dummy_authorization_handler ) do |workflow |
10+ workflow . form = "Decidim::AnotherDummyAuthorizationHandler"
11+ end
You can’t perform that action at this time.
0 commit comments