lib/eco/api/microcases/set_account.rb in eco-helpers-2.7.24 vs lib/eco/api/microcases/set_account.rb in eco-helpers-2.7.25
- old
+ new
@@ -3,17 +3,16 @@
class MicroCases
# @param entry [PersonEntry] the input entry with the data we should set on person.
# @param person [Ecoportal::API::V1::Person] the person we want to update, carrying the changes to be done.
# @param options [Hash] the options.
def set_account(entry, person, options)
- unless options.dig(:exclude, :account)
- entry.set_account(person, exclude: micro.account_excluded(person, options))
+ return if options.dig(:exclude, :account)
- person.account.send_invites = options[:send_invites] if options.key?(:send_invites)
- micro.refresh_default_tag(entry, person, options)
- micro.fix_default_group(entry, person, options)
- end
- end
+ entry.set_account(person, exclude: micro.account_excluded(person, options))
+ person.account.send_invites = options[:send_invites] if options.key?(:send_invites)
+ micro.refresh_default_tag(entry, person, options)
+ micro.fix_default_group(entry, person, options)
+ end
end
end
end