Module: Eco::API::MicroCases::People::ApplyChanges::SetCore::CoreExcluded
- Included in:
- Eco::API::MicroCases::People::ApplyChanges::SetCore
- Defined in:
- lib/eco/api/microcases/people/apply_changes/set_core/core_excluded.rb
Constant Summary collapse
- CAN_EXCLUDE_CREATION =
%w[filter_tags archived contractor_organization_id].freeze
- CAN_EXCLUDE_UPDATE =
%w[name external_id email filter_tags contractor_organization_id].freeze
Instance Method Summary collapse
-
#core_excluded(person, options) ⇒ Array<String>
The core parameters that should not be included.
Instance Method Details
#core_excluded(person, options) ⇒ Array<String>
Note:
by default supervisor_id is always excluded.
Returns the core parameters that should not be included.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/eco/api/microcases/people/apply_changes/set_core/core_excluded.rb', line 15 def core_excluded(person, ) ['supervisor_id'].tap do |core_excluded| can_exclude = person.new?? CAN_EXCLUDE_CREATION : CAN_EXCLUDE_UPDATE exclusions = can_exclude.select do |attr| .dig(:exclude, attr.to_sym) end core_excluded.concat(exclusions) end end |