lib/eco/api/microcases/with_each_starter.rb in eco-helpers-2.0.18 vs lib/eco/api/microcases/with_each_starter.rb in eco-helpers-2.0.19
- old
+ new
@@ -13,11 +13,13 @@
# @yieldparam person [Ecoportal::API::V1::Person] the **new** person.
# @return [Eco::API::Organization::People] the starters.
def with_each_starter(entries, people, options, log_present: false)
starters = []
micro.with_each(entries, people, options) do |entry, person|
- if !person.new? && log_present
- session.logger.error("This person (id: '#{person.id}') already exists: #{entry.to_s(:identify)}")
+ if !person.new?
+ if log_present
+ session.logger.error("This person (id: '#{person.id}') already exists: #{entry.to_s(:identify)}")
+ end
next
end
starters << person
yield(entry, person) if block_given?
end