Sha256: 73f77a45ba6ff39e1d3b7a0eba3403432768614642a3e861191e85b83e911ff8

Contents?: true

Size: 615 Bytes

Versions: 4

Compression:

Stored size: 615 Bytes

Contents

class Eco::API::UseCases::Default::People::ReinviteTransCase < Eco::API::Common::Loaders::UseCase
  name "reinvite"
  type :transform

  def main(people, session, options, usecase)
    reinvite(people.users)
  end

  private

  def reinvite(users)
    invite = session.new_job("main", "invite", :update, usecase, :account)
    users.each do |person|
      if force_invite?
        person.account.force_send_invites = true
      else
        person.account.send_invites = true
      end
      invite.add(person)
    end
  end

  def force_invite?
    options.dig(:force, :invite)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
eco-helpers-2.7.4 lib/eco/api/usecases/default/people/reinvite_trans_case.rb
eco-helpers-2.7.2 lib/eco/api/usecases/default/people/reinvite_trans_case.rb
eco-helpers-2.7.1 lib/eco/api/usecases/default/people/reinvite_trans_case.rb
eco-helpers-2.7.0 lib/eco/api/usecases/default/people/reinvite_trans_case.rb