Skip to content

Commit 1084557

Browse files
authored
Merge pull request #365 from intercom/AP/type_field
Return object type
2 parents 4212acf + 1420179 commit 1084557

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This version of the gem is compatible with `Ruby 2.1` and above.
2222

2323
Using bundler:
2424

25-
gem 'intercom', '~> 3.5.21'
25+
gem 'intercom', '~> 3.5.22'
2626

2727
## Basic Usage
2828

changes.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
3.5.22
2+
- Return object type
3+
14
3.5.21
25
- Fix for PR-353 which addressed "NoMethodError in intercom/request"
36
- There were issues on older versions of Ruby (<2.3)

circle.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
machine:
2+
ruby:
3+
version: 2.1.0
4+
test:
5+
post:
6+
- bundle exec rake

lib/intercom/traits/api_resource.rb

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

2525
def from_hash(hash)
2626
hash.each do |attribute, value|
27-
next if type_field?(attribute)
2827
initialize_property(attribute, value)
2928
end
3029
initialize_missing_flat_store_attributes if respond_to? :flat_store_attributes
@@ -106,10 +105,6 @@ def call_setter_for_attribute(attribute, value)
106105
self.send(setter_method, value)
107106
end
108107

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

spec/unit/intercom/traits/api_resource_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@
4141

4242
before(:each) { api_resource.from_response(object_json) }
4343

44-
it "does not set type on parsing json" do
45-
api_resource.wont_respond_to :type
46-
end
47-
4844
it "coerces time on parsing json" do
4945
assert_equal Time.at(1374056196), api_resource.created_at
5046
end

0 commit comments

Comments
 (0)