Module: Eco::API::MicroCases::People::ApplyChanges::SetAccount::AccountExcluded

Included in:
Eco::API::MicroCases::People::ApplyChanges::SetAccount
Defined in:
lib/eco/api/microcases/people/apply_changes/set_account/account_excluded.rb

Instance Method Summary collapse

Instance Method Details

#account_excluded(person, options) ⇒ Array<String>

Returns the account parameters that should not be included.

Parameters:

  • person (Ecoportal::API::V1::Person)

    the person we want to update, carrying the changes to be done.

  • options (Hash)

    the options.

Returns:

  • (Array<String>)

    the account parameters that should not be included.



11
12
13
14
15
16
17
18
19
# File 'lib/eco/api/microcases/people/apply_changes/set_account/account_excluded.rb', line 11

def (person, options)
  [].tap do ||
    next if person.new?

    .push('policy_group_ids')   if options.dig(:exclude, :policy_groups)
    .push('default_tag')        if options.dig(:exclude, :default_tag)
    .push('login_provider_ids') if options.dig(:exclude, :login_providers)
  end
end