Sha256: 86d45f1e978fe621df439defdef369b76618558afbb3c08038ca9da24bac3d3e
Contents?: true
Size: 1.29 KB
Versions: 10
Compression:
Stored size: 1.29 KB
Contents
module Eco module API class UseCases class DefaultCases class RemoveAccountCase < DefaultCase def process @cases.define("remove-account", type: :transform) do |people, session, options, usecase| update = session.job_group("main").new("update", usecase: usecase, type: :update, sets: [:core, :account]) people.users.map do |person| person.account = nil update.add(person) end end @cases.define("remove-account", type: :sync) do |entries, people, session, options| update = session.job_group("main").new("update", type: :update, sets: [:core, :account]) strict_search = session.config.people.strict_search? && (!options[:search]&.key?(:strict) || options.dig(:search, :strict)) entries.each.with_index do |entry, i| if person = people.find(entry, strict: strict_search) person.account = nil update.add(person) else session.logger.error("Entry(#{i}) - this person does not exist: #{entry.to_s(:identify)}") end end end end end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems