Sha256: 5ee9c5141e6b42f7b92065786f2c74be53b00dc4e60cfd50dbde7617dbcca144
Contents?: true
Size: 1001 Bytes
Versions: 106
Compression:
Stored size: 1001 Bytes
Contents
module Eco module API class MicroCases # Helper to preserve the original filter tags. # @note # 1. It only works if the original value of `filter_tags` 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. # @param keep_new [Boolean] tells if it should keep the new tags or get rid of them. # @return [Array<String>] the final value of `filter_tags`. def preserve_filter_tags(person, options, keep_new: false) if person.as_update.key?("filter_tags") if original = person.original_doc["filter_tags"] unless original.empty? if keep_new person.filter_tags += original else person.filter_tags = original end end end end person.filter_tags end end end end
Version data entries
106 entries across 106 versions & 1 rubygems