lib/eco/api/usecases/default_cases/create_case.rb in eco-helpers-2.0.25 vs lib/eco/api/usecases/default_cases/create_case.rb in eco-helpers-2.0.26
- old
+ new
@@ -1,18 +1,27 @@
class Eco::API::UseCases::DefaultCases::CreateCase < Eco::API::Common::Loaders::UseCase
name "create"
type :sync
+ attr_reader :options
+
def main(entries, people, session, options, usecase)
+ options = @options
micro = session.micro
creation = session.new_job("main", "create", :create, usecase)
supers = session.new_job("post", "supers", :update, usecase, :core)
- micro.with_each_starter(entries, people, options, log_present: true) do |entry, person|
+ micro.with_each_starter(entries, people, options, log_present: true, append_created: append_created) do |entry, person|
creation.add(person)
micro.set_core_with_supervisor(entry, person, people, supers, options)
entry.set_details(person) unless options.dig(:exclude, :details)
micro.set_account(entry, person, options)
end
+ end
+
+ private
+
+ def append_created
+ options.dig(:people, :append_created)
end
end