Skip to content

Commit aaacbf3

Browse files
committed
update to remove company-id reference
1 parent 13d7c47 commit aaacbf3

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

lib/intercom/user.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,11 @@ def companies=(companies)
338338

339339
##
340340
# Creates a UserEvent for the given User
341-
# @param {Hash} options, keys for :created (Unix timestamp) and :company_id (String)
341+
# @param {Hash} options, keys for :created_at (Unix timestamp) and metadata
342342
def log_event(event_name, options={})
343343
attributes = {:event_name => event_name, :user => self}
344-
attributes[:created] = options[:created] unless options[:created].nil?
345-
attributes[:company_id] = options[:company_id] unless options[:company_id].nil?
344+
attributes[:created_at] = options[:created_at] unless options[:created_at].nil?
345+
attributes[:metadata] = options[:metadata] unless options[:metadata].nil?
346346
UserEvent.create(attributes)
347347
end
348348

lib/intercom/user_event.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ module Intercom
1212
#
1313
# == Examples
1414
#
15-
# user_event = Intercom::UserEvent.create(:event_name => "post", :user => current_user, :created => Time.now)
15+
# user_event = Intercom::UserEvent.create(:event_name => "post", :user => current_user, :created_at => Time.now)
1616
#
1717
# You can also create an user-event and save it like this:
1818
# user_event = Intercom::UserEvent.new
1919
# user_event.event_name = "publish-post"
2020
# user_event.user = current_user
21-
# user_event.created = Time.now
21+
# user_event.created_at = Time.now
2222
# user_event.metadata = {
2323
# :title => 'Gravity Review',
2424
# :link => 'https://example.org/posts/22',

lib/intercom/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Intercom #:nodoc:
2-
VERSION = "0.2.0"
2+
VERSION = "0.2.1"
33
end

spec/unit/intercom/user_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@
268268
Intercom::UserEvent.expects(:create).with(:event_name => 'registration', :user => user)
269269
event = user.log_event('registration')
270270

271-
Intercom::UserEvent.expects(:create).with(:event_name => 'another', :user => user, :created => 1391691571, :company_id => "6")
272-
event = user.log_event("another", {:created => 1391691571, :company_id => "6"})
271+
Intercom::UserEvent.expects(:create).with(:event_name => 'another', :user => user, :created_at => 1391691571)
272+
event = user.log_event("another", {:created_at => 1391691571})
273273
end
274274
end

0 commit comments

Comments
 (0)