-
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
a4198a9
commit 84acf37
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...ands/concerns/decidim/privacy/admin/create_participatory_space_private_user_extensions.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,27 @@ | ||
# frozen_string_literal: true | ||
|
||
module Decidim | ||
module Privacy | ||
module Admin | ||
module CreateParticipatorySpacePrivateUserExtensions | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
private | ||
|
||
def existing_user | ||
return @existing_user if defined?(@existing_user) | ||
|
||
@existing_user = Decidim::User.entire_collection.find_by( | ||
email: form.email.downcase, | ||
organization: private_user_to.organization | ||
) | ||
|
||
InviteUserAgain.call(@existing_user, invitation_instructions) if @existing_user&.invitation_pending? | ||
@existing_user | ||
end | ||
end | ||
end | ||
end | ||
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