Sha256: 4c3ccb42c71104f7bdd810374bdd4822f40d92e43f88b91b2be0cf63259bcbf8

Contents?: true

Size: 793 Bytes

Versions: 16

Compression:

Stored size: 793 Bytes

Contents

module EgovUtils
  module RegistrationRequests
    class CheckAutoAccept < ActiveInteraction::Base
      record :registration_request, class: 'EgovUtils::RegistrationRequest'

      def execute
        member = nil
        EgovUtils::Group.where.not(provider: nil).detect do |g|
          member = g.ldap_members.detect do |m|
            m[:login] == registration_request.mail
          end
        end

        return unless member

        registration_request.update(
          status: 'accepted',
          internal_reason:
            'Automaticky schválen na základě členství v LDAP skupině'
        )

        EgovUtils::RegistrationRequestMailer
          .auto_accepted(registration_request.id)
          .deliver_now

        registration_request
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
egov_utils-1.5.0.alpha16 app/services/egov_utils/registration_requests/check_auto_accept.rb
egov_utils-1.5.0.alpha15 app/services/egov_utils/registration_requests/check_auto_accept.rb
egov_utils-1.5.0.alpha14 app/services/egov_utils/registration_requests/check_auto_accept.rb
egov_utils-1.5.0.alpha13 app/services/egov_utils/registration_requests/check_auto_accept.rb
egov_utils-1.5.0.alpha12 app/services/egov_utils/registration_requests/check_auto_accept.rb
egov_utils-1.5.0.alpha11 app/services/egov_utils/registration_requests/check_auto_accept.rb
egov_utils-1.5.0.alpha10 app/services/egov_utils/registration_requests/check_auto_accept.rb
egov_utils-1.5.0.alpha9 app/services/egov_utils/registration_requests/check_auto_accept.rb
egov_utils-1.5.0.alpha8 app/services/egov_utils/registration_requests/check_auto_accept.rb
egov_utils-1.5.0.alpha7 app/services/egov_utils/registration_requests/check_auto_accept.rb
egov_utils-1.5.0.alpha6 app/services/egov_utils/registration_requests/check_auto_accept.rb
egov_utils-1.5.0.alpha5 app/services/egov_utils/registration_requests/check_auto_accept.rb
egov_utils-1.5.0.alpha4 app/services/egov_utils/registration_requests/check_auto_accept.rb
egov_utils-1.5.0.alpha3 app/services/egov_utils/registration_requests/check_auto_accept.rb
egov_utils-1.5.0.alpha2 app/services/egov_utils/registration_requests/check_auto_accept.rb
egov_utils-1.5.0.alpha1 app/services/egov_utils/registration_requests/check_auto_accept.rb