Module: Eco::API::MicroCases::People::ApplyChanges::SetCore

Includes:
CoreExcluded
Included in:
Eco::API::MicroCases::People::ApplyChanges
Defined in:
lib/eco/api/microcases/people/apply_changes/set_core.rb,
lib/eco/api/microcases/people/apply_changes/set_core/core_excluded.rb

Defined Under Namespace

Modules: CoreExcluded

Constant Summary

Constants included from CoreExcluded

CoreExcluded::CAN_EXCLUDE_CREATION, CoreExcluded::CAN_EXCLUDE_UPDATE

Instance Method Summary collapse

Methods included from CoreExcluded

#core_excluded

Instance Method Details

#set_core(entry, person, options) ⇒ Object

Note:

supervisor_id requires a special treatment, and therefore is always excluded.

Sets all the core details, but the supervisor.

Parameters:

  • entry (PersonEntry)

    the input entry with the data we should set on person.

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

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

  • options (Hash)

    the options



16
17
18
19
20
21
# File 'lib/eco/api/microcases/people/apply_changes/set_core.rb', line 16

def set_core(entry, person, options)
  return if options.dig(:exclude, :core) && !person.new?

  entry.set_core(person, exclude: micro.core_excluded(person, options))
  micro.fix_filter_tags(person, options)
end