lib/ecoportal/api/v1/person.rb in ecoportal-api-0.7.2 vs lib/ecoportal/api/v1/person.rb in ecoportal-api-0.7.3
- old
+ new
@@ -41,14 +41,14 @@
def supervisor=(person)
self.supervisor_id = person&.id || person&.external_id
end
# Sets the email of a person.
- # @param email [String, nil] the email of this person.
+ # @param value [String, nil] the email of this person.
def email=(value)
unless !value || value.match(VALID_EMAIL_REGEX)
- raise "Invalid email #{email.inspect}"
+ raise "Invalid email #{value.inspect}"
end
doc["email"] = value&.downcase
end
# Validates the string tags of the array, and sets the `filter_tags` property of the account.
@@ -67,9 +67,10 @@
end.uniq
ini_tags = (original_doc && original_doc["filter_tags"]) || []
# preserve original order to avoid false updates
doc["filter_tags"] = (ini_tags & end_tags) + (end_tags - ini_tags)
+ doc["filter_tags"].compact!
end
# @return [Array<String>] the filter tags of this person.
def filter_tags
doc["filter_tags"] ||= []