Sha256: 69814bec4aa82f31d4cbbf91121dfafce84874423de175b907e6b62f08b6692e
Contents?: true
Size: 1.09 KB
Versions: 16
Compression:
Stored size: 1.09 KB
Contents
module Eco module API module UseCases class DefaultCases class RemoveAccountCase < BaseCase def process @cases.define("remove-account", type: :transform) do |people, session| update = session.job_group("main").new("update", 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| update = session.job_group("main").new("update", type: :update, sets: [:core, :account]) entries.each.with_index do |entry, i| if person = people.find(entry) 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
16 entries across 16 versions & 1 rubygems