Sha256: 9ec90676f9021af0d727d44ee61d4adcd38e8bf53e18ac05c971f53f55eb5ea4
Contents?: true
Size: 807 Bytes
Versions: 110
Compression:
Stored size: 807 Bytes
Contents
module Eco module API class MicroCases # Helper to preserve the original `default_tag`. # @note # 1. It only works if the original value of `default_tag` was **not** empty # @param person [Ecoportal::API::V1::Person] the person we want to update, carrying the changes to be done. # @param options [Hash] the options. # @return [String] the final value of `default_tag`. def preserve_default_tag(person, options) if account = person.account if account.as_update.key?("default_tag") if original = person.original_doc.dig("account", "default_tag") person.account.default_tag = original end end end person.account&.default_tag end end end end
Version data entries
110 entries across 110 versions & 1 rubygems