Sha256: c9aff86eff15a842e3caf53abc36ac8408c602f70c77fa3bc8585e6d952a7481
Contents?: true
Size: 568 Bytes
Versions: 23
Compression:
Stored size: 568 Bytes
Contents
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).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
23 entries across 23 versions & 1 rubygems