Skip to content

Commit 4212acf

Browse files
committed
Revert "Return object type in API"
This reverts commit c5ebd86.
1 parent 0c242cc commit 4212acf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/intercom/traits/api_resource.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def from_response(response)
2424

2525
def from_hash(hash)
2626
hash.each do |attribute, value|
27+
next if type_field?(attribute)
2728
initialize_property(attribute, value)
2829
end
2930
initialize_missing_flat_store_attributes if respond_to? :flat_store_attributes
@@ -105,6 +106,10 @@ def call_setter_for_attribute(attribute, value)
105106
self.send(setter_method, value)
106107
end
107108

109+
def type_field?(attribute)
110+
attribute.to_s == 'type'
111+
end
112+
108113
def initialize_missing_flat_store_attributes
109114
flat_store_attributes.each do |attribute|
110115
unless instance_variables_excluding_dirty_tracking_field.map(&:to_s).include? "@#{attribute}"

0 commit comments

Comments
 (0)