Skip to content

Instantly share code, notes, and snippets.

@erskingardner
Created November 24, 2014 14:02
Show Gist options
  • Save erskingardner/50b179cbad21c0574a03 to your computer and use it in GitHub Desktop.
Save erskingardner/50b179cbad21c0574a03 to your computer and use it in GitHub Desktop.
# List of tag ids from spreadsheet.
to_delete = [18784,18115,47438,50918,41470,43254,43249,39577,51512,27977,36212,40711,45077,18340,51647,51391,41513,488,17219,480,11441,26528,11373,31387,32759,27236,38372,39341,38025,38167,39240,43167,36946,37363,13176,481,14056,16786,28574,17641,27794,36336,27981,36704,36706,17697,27983,47791,36441,47513,27834,27237,47287,47358,27652,19361,32083,15549,40809,34407,17649,16682,41340,41341,26222,29911,44684,28134,38510,39076,37375,31424,41966,40031,7431,30576,44967,44961,468,46630,41071,31856,18037,7609,46256,48165,48173,487,38866,42745,13310,9170,48184,41253,16687,41518,13151,17594,49801,49833,8613,51518,36810,11654,171,8607,38430,31386,26886,48991,41469,34146,41446,26527,31740,49008,51507,8873,40935,496,30777,17574,17572,17916,17577,17807,17578,40337,31769,484,51194,32541,18960,50285,482,47455,46782,26530,51231,51400,6963,11755,50185,37319,46328,39355,40034,40376,40326,28292,11548,41976,40157,37011,37012,47200,48825,32715,50079]
# Get Intercom
a = App.find 6
# Get a list of live auto messages so that we know if anything is stopped by this process
live_auto_message_ids = a.messages.auto.live.map(&:id)
# Bombs away
to_delete.each do |id|
t = a.manual_tags.find id
t.destroy unless t.blank?
end
# Get list of messages again
after_live_auto_message_ids = a.reload.messages.auto.live.map(&:id)
# Compare lists of messages
stopped_messages = live_auto_message_ids - after_live_auto_message_ids
@jkogara
Copy link

jkogara commented Nov 24, 2014

👍 LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment