Sha256: a6a129d76037dc1b63b37d9c0ab5f8d610be43496cbc730c5c6e8a4bcf80232c

Contents?: true

Size: 617 Bytes

Versions: 5

Compression:

Stored size: 617 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

5 entries across 5 versions & 1 rubygems

Version Path
eco-helpers-2.6.4 lib/eco/api/usecases/default/people/reinvite_trans_case.rb
eco-helpers-2.6.3 lib/eco/api/usecases/default/people/reinvite_trans_case.rb
eco-helpers-2.6.2 lib/eco/api/usecases/default/people/reinvite_trans_case.rb
eco-helpers-2.6.1 lib/eco/api/usecases/default/people/reinvite_trans_case.rb
eco-helpers-2.6.0 lib/eco/api/usecases/default/people/reinvite_trans_case.rb