Sha256: 5f3ac0680c25c0a4ae7a3c7ca86f64e8b5efa32b3d41dfc7837a371f5915a83f
Contents?: true
Size: 604 Bytes
Versions: 19
Compression:
Stored size: 604 Bytes
Contents
# frozen_string_literal: true module Spotlight ## # A simple service to invite any users who where created by an invitation but it was never sent. # This is done because the associated information between the resource, the role, and the user # need to be persisted in order to generate the appropriate content in the invitation email. class InviteUsersService def self.call(resource:) resource.roles.includes(:user).find_each do |role| user = role.user user.deliver_invitation if user.created_by_invite? && user.invitation_sent_at.blank? end end end end
Version data entries
19 entries across 19 versions & 1 rubygems