intercom 3.0.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6e82c397ffb446b76fa64b74ae2409251fa1e3b
4
- data.tar.gz: c01df9fee74bda29ba743fe404f0ba6081eb6e7c
3
+ metadata.gz: 5110cc550072f76df8878bc01d5ae52713792ac7
4
+ data.tar.gz: 24ce0af5e5b1abd006748327dacca2119285b6c6
5
5
  SHA512:
6
- metadata.gz: 8fb8b79d4e91b9a14cfd93de327b9b4a866e192b4025ab0ea5328239c1f54c5c1243832cb3eb2e2770d2e5de04f9eb064d8bb54baa2559f3a614e16b0b205a54
7
- data.tar.gz: 44c84f6abbcc6b217b58802bd738017e963caeb6eb7036ef751baf00937e5d761e10244f63bba9a96d663f2276e142a7379fcf02e258ead0e8f24ac34b8708a5
6
+ metadata.gz: 802a609a8cb9c6a7754c87a2a42553717918eb65cd0494e8da858f96e597ff419677a53aaeaafa7e8cf80fcb85587021581634f9ad9f5a576026e01ed67d8cb5
7
+ data.tar.gz: 874a3afb3edd697a352a6a8f16c3ec45d0e7e098286953530a47496b68267ed355f5ec0d372ff84b563bbb7d0d9d30f538f6689899a4d83f923b6d33aa1ad5a9
data/README.md CHANGED
@@ -22,7 +22,7 @@ This version of the gem is compatible with `Ruby 2.1` and above.
22
22
 
23
23
  Using bundler:
24
24
 
25
- gem 'intercom', "~> 3.0.2"
25
+ gem 'intercom', "~> 3.0.3"
26
26
 
27
27
  ## Basic Usage
28
28
 
@@ -64,7 +64,8 @@ user = intercom.users.find(:id => "1")
64
64
  # Create a user
65
65
  user = intercom.users.create(:email => "bob@example.com", :name => "Bob Smith", :signed_up_at => Time.now.to_i)
66
66
  # Delete a user
67
- deleted_user = intercom.users.find(:id => "1").delete
67
+ user = intercom.users.find(:id => "1")
68
+ deleted_user = intercom.users.delete(user)
68
69
  # Update custom_attributes for a user
69
70
  user.custom_attributes["average_monthly_spend"] = 1234.56
70
71
  intercom.users.save(user)
data/changes.txt CHANGED
@@ -1,3 +1,6 @@
1
+ 3.0.3
2
+ - Fix untagging
3
+
1
4
  3.0.2
2
5
  - Fix bad .gem push :(
3
6
 
@@ -23,8 +23,17 @@ module Intercom
23
23
 
24
24
  def untag(params)
25
25
  params['tag_or_untag'] = 'untag'
26
+ users_or_companies.each do |user_or_company|
27
+ user_or_company[:untag] = true
28
+ end
26
29
  create(params)
27
30
  end
31
+
32
+ private
33
+
34
+ def users_or_companies
35
+ params[:users] || params[:companies]
36
+ end
28
37
  end
29
38
  end
30
39
  end
@@ -1,3 +1,3 @@
1
1
  module Intercom #:nodoc:
2
- VERSION = "3.0.2"
2
+ VERSION = "3.0.3"
3
3
  end
@@ -23,7 +23,7 @@ describe "Intercom::Tag" do
23
23
  end
24
24
 
25
25
  it 'untags users' do
26
- client.expects(:post).with("/tags", {'name' => "Test Tag", 'users' => [ { user_id: 'abc123' }, { user_id: 'def456' } ], 'tag_or_untag' => 'untag'}).returns(test_tag)
26
+ client.expects(:post).with("/tags", {'name' => "Test Tag", 'users' => [ { user_id: 'abc123', untag: true }, { user_id: 'def456', untag: true } ], 'tag_or_untag' => 'untag'}).returns(test_tag)
27
27
  client.tags.untag(:name => "Test Tag", :users => [ { user_id: "abc123" }, { user_id: "def456" } ])
28
28
  end
29
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intercom
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben McRedmond
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2015-06-08 00:00:00.000000000 Z
18
+ date: 2015-07-08 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: minitest
@@ -202,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  version: '0'
203
203
  requirements: []
204
204
  rubyforge_project: intercom
205
- rubygems_version: 2.4.5
205
+ rubygems_version: 2.2.2
206
206
  signing_key:
207
207
  specification_version: 4
208
208
  summary: Ruby bindings for the Intercom API
@@ -226,3 +226,4 @@ test_files:
226
226
  - spec/unit/intercom/traits/api_resource_spec.rb
227
227
  - spec/unit/intercom/user_spec.rb
228
228
  - spec/unit/intercom_spec.rb
229
+ has_rdoc: