Skip to content

Instantly share code, notes, and snippets.

View detkin's full-sized avatar

Dylan Etkin detkin

View GitHub Profile
@detkin
detkin / twilio_comp_merge.rb
Created February 10, 2016 18:11
This is to merge the two twilio components into on new component in the same group and with all of the subscribers automatically subscribed to the new component.
def merge_twilio_components
c1 = Component.find('pysn09gt7s41')
c2 = Component.find('8slry56nyr1z')
new_comp = Component.new(name: 'SIP', description: 'Network Traversal Service - SIP', page: c1.page, group_id: c1.group_id, only_show_if_degraded: true)
new_comp.save
# Run through and move subscribers from the old comps to the new
page_sub_set = Set.new
page_sub_set.merge(c1.subscribers.to_set)
page_sub_set.merge(c2.subscribers.to_set)

Keybase proof

I hereby claim:

  • I am detkin on github.
  • I am detkin (https://keybase.io/detkin) on keybase.
  • I have a public key whose fingerprint is 392C 1CF0 66ED F44C 730A 02E5 9A62 4039 7B60 6745

To claim this, I am signing this object: