-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
980da32
commit 22b34c8
Showing
5 changed files
with
79 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
app/models/concerns/dgfip_extensions/api_impot_particulier_modalities.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module DGFIPExtensions::APIImpotParticulierModalities | ||
extend ActiveSupport::Concern | ||
|
||
MODALITIES = %w[with_france_connect with_spi with_etat_civil].freeze | ||
|
||
included do | ||
include AuthorizationExtensions::Modalities | ||
|
||
add_attributes :france_connect_authorization_id | ||
validates :france_connect_authorization_id, | ||
presence: true, | ||
if: -> { modalities == 'with_france_connect' && need_complete_validation?(:modalities) } | ||
end | ||
|
||
def associated_france_connect_authorization | ||
return nil if france_connect_authorization_id.blank? | ||
|
||
Authorization.find(france_connect_authorization_id) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters