Sha256: edd00e701458706c7e6ca398250b9d0e1d237379d1092e222be62a4f41340ca7

Contents?: true

Size: 642 Bytes

Versions: 8

Compression:

Stored size: 642 Bytes

Contents

class Eco::API::UseCases::DefaultCases::SetSupervisorCase < Eco::API::Common::Loaders::UseCase
  name "set-supervisor"
  type :sync

  def main(entries, people, session, options, usecase)
    update   = session.new_job("main", "update", :update, usecase)

    micro.with_each_present(entries, people, options, log_starter: true) do |entry, person|
      if entry.supervisor_id?
        micro.set_supervisor(person, entry.supervisor_id, people, options) do |unknown_id|
          session.logger.warn("Supervisor '#{entry.supervisor_id}' does not exist. Entry: #{entry.to_s(:identify)}")
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
eco-helpers-2.5.10 lib/eco/api/usecases/default_cases/set_supervisor_case.rb
eco-helpers-2.5.9 lib/eco/api/usecases/default_cases/set_supervisor_case.rb
eco-helpers-2.5.8 lib/eco/api/usecases/default_cases/set_supervisor_case.rb
eco-helpers-2.5.7 lib/eco/api/usecases/default_cases/set_supervisor_case.rb
eco-helpers-2.5.6 lib/eco/api/usecases/default_cases/set_supervisor_case.rb
eco-helpers-2.5.5 lib/eco/api/usecases/default_cases/set_supervisor_case.rb
eco-helpers-2.5.4 lib/eco/api/usecases/default_cases/set_supervisor_case.rb
eco-helpers-2.5.3 lib/eco/api/usecases/default_cases/set_supervisor_case.rb