Skip to content

Commit 19fb796

Browse files
Ashley McClellandAshley McClelland
Ashley McClelland
authored and
Ashley McClelland
committed
update company name using company id via command line
1 parent 02b944e commit 19fb796

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# intercom-ruby
22

3+
**Fork of intercom/intercom-ruby with specific command line scripts to perform tasks that are not accessible via Intercom's UI (ie: updating company name.)**
4+
35
Ruby bindings for the Intercom API (https://api.intercom.io).
46

57
[API Documentation](https://api.intercom.io/docs)

update_company.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require "intercom"
2+
require "./secret.rb"
3+
4+
#enter company id
5+
puts "enter company id"
6+
company_id = gets.chomp
7+
company = Intercom::Company.find(:id => company_id)
8+
puts "current company name is #{company.name}. Would you like to continue? [y/n]"
9+
answer = gets.chomp
10+
if answer == "y"
11+
puts "enter new company name (will override current company name)"
12+
else
13+
exit
14+
end
15+
company.name = gets.chomp
16+
company.save
17+
puts "company id #{company_id} is now #{company.name}"

0 commit comments

Comments
 (0)