diff --git a/lib/nylas/model/attributes.rb b/lib/nylas/model/attributes.rb index 1dfe324b..0860ebc6 100644 --- a/lib/nylas/model/attributes.rb +++ b/lib/nylas/model/attributes.rb @@ -33,7 +33,7 @@ def merge(new_data) def to_h(keys: attribute_definitions.keys) keys.each_with_object({}) do |key, casted_data| value = attribute_definitions[key].serialize(self[key]) - casted_data[key] = defaulted_value(value) + casted_data[key] = value unless value.nil? end end @@ -44,13 +44,6 @@ def serialize(keys: attribute_definitions.keys) private def default_attributes attribute_definitions.keys.zip([]).to_h end - - private def defaulted_value(value) - result = value unless value.nil? || (value.respond_to?(:empty?) && value.empty?) - result ||= [] if value.is_a?(Array) - result ||= "" unless [true, false].include?(value) - result - end end end end