lib/eco/cli/config/default/workflow.rb in eco-helpers-2.0.19 vs lib/eco/cli/config/default/workflow.rb in eco-helpers-2.0.21

- old
+ new

@@ -51,12 +51,11 @@ wf_load.for(:people) do |wf_people| wf_people.on(:get) do |wf_people_get, io| cases_with_people = config.usecases.active(io: io).select do |usecase, data| io.class.people_required?(usecase.type) end - get_people = io.options.dig(:people, :get, :from) == :remote - next io unless !cases_with_people.empty? || get_people + next io if cases_with_people.empty? && !io.options.dig(:people, :get) io = io.new(people: config.people(io: io)) end wf_people.on(:filter) do |wf_people_filter, io| next io unless io.people && !io.people.empty? @@ -65,11 +64,12 @@ end end wf.before(:usecases) do |wf_cases, io| # save partial entries -> should be native to session.workflow - partial_update = io.options.dig(:people, :get, :type) == :partial + get_people = io.options.dig(:people, :get) + partial_update = get_people && get_people.dig(:type) == :partial if !io.options[:dry_run] && partial_update partial_file = io.session.config.people.partial_cache io.session.file_manager.save_json(io.people, partial_file, :timestamp) end io @@ -96,11 +96,12 @@ wf.before(:post_launch) do |wf_post, io| if io.session.post_launch.empty? wf_post.skip! else - partial_update = io.options.dig(:people, :get, :type) == :partial + get_people = io.options.dig(:people, :get) + partial_update = get_people && get_people.dig(:type) == :partial if !io.options[:dry_run] && partial_update # get target people afresh people = io.session.micro.people_refresh(people: io.people, include_created: true) io = io.new(people: people) else @@ -137,10 +138,11 @@ #io.session.reports io end wf.on(:end) do |wf_end, io| - partial_update = io.options.dig(:people, :get, :type) == :partial + get_people = io.options.dig(:people, :get) + partial_update = get_people && get_people.dig(:type) == :partial unless !io.options[:end_get] || io.options[:dry_run] || partial_update people = io.session.micro.people_cache io = io.new(people: people) end io