Sha256: 57bc834325ac9198c3dc9481ffb73003fb516c970d2219fdc20d58903f8129fa

Contents?: true

Size: 774 Bytes

Versions: 14

Compression:

Stored size: 774 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # Custom ApplicationJob scoped to the admin panel.
    #
    class VerifyUserGroupFromCsvJob < ApplicationJob
      queue_as :default

      def perform(email, verifier, organization)
        @organization = organization
        @email = email.downcase.strip

        return if email.blank?
        return unless user_group

        Decidim::Admin::VerifyUserGroup.call(user_group, verifier, true)
      end

      private

      def user_group
        @user_group ||= UserGroup.where(organization: @organization)
                                 .where.not(confirmed_at: nil)
                                 .not_verified
                                 .find_by(email: @email)
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
decidim-admin-0.23.6 app/jobs/decidim/admin/verify_user_group_from_csv_job.rb
decidim-admin-0.23.5 app/jobs/decidim/admin/verify_user_group_from_csv_job.rb
decidim-admin-0.23.4 app/jobs/decidim/admin/verify_user_group_from_csv_job.rb
decidim-admin-0.23.3 app/jobs/decidim/admin/verify_user_group_from_csv_job.rb
decidim-admin-0.23.2 app/jobs/decidim/admin/verify_user_group_from_csv_job.rb
decidim-admin-0.23.1 app/jobs/decidim/admin/verify_user_group_from_csv_job.rb
decidim-admin-0.23.1.rc1 app/jobs/decidim/admin/verify_user_group_from_csv_job.rb
decidim-admin-0.23.0 app/jobs/decidim/admin/verify_user_group_from_csv_job.rb
decidim-admin-0.22.0 app/jobs/decidim/admin/verify_user_group_from_csv_job.rb
decidim-admin-0.21.0 app/jobs/decidim/admin/verify_user_group_from_csv_job.rb
decidim-admin-0.20.1 app/jobs/decidim/admin/verify_user_group_from_csv_job.rb
decidim-admin-0.20.0 app/jobs/decidim/admin/verify_user_group_from_csv_job.rb
decidim-admin-0.19.1 app/jobs/decidim/admin/verify_user_group_from_csv_job.rb
decidim-admin-0.19.0 app/jobs/decidim/admin/verify_user_group_from_csv_job.rb