Sha256: dc030d575eb56bc085c83e03d93d3760621ff7d6ef72d414a3189147eeddf21e
Contents?: true
Size: 1.13 KB
Versions: 139
Compression:
Stored size: 1.13 KB
Contents
module Eco module API class MicroCases # When the input data, or `entry`, does not provide the `default_tag`, # it sets the `default_tag` of the user following some criteria # @note it assumes `default_tag` has been already set to `person.account` # @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 refresh_default_tag(entry, person, options) if person.account unless options.dig(:exclude, :account) unless options.dig(:exclude, :filter_tags) || options.dig(:exclude, :default_tag) || entry&.default_tag? if session.tagtree person.account.default_tag = session.tagtree.default_tag(*person.filter_tags) else tags = person.filter_tags || [] person.account.default_tag = tags.first unless tags.length > 1 end end end end end end end end
Version data entries
139 entries across 139 versions & 1 rubygems