Skip to content

Instantly share code, notes, and snippets.

@simonista
Created December 5, 2012 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonista/4219798 to your computer and use it in GitHub Desktop.
Save simonista/4219798 to your computer and use it in GitHub Desktop.
guid = ...
LearningOutcomeGroup.find_by_vendor_guid(guid).destroy
LearningOutcomeGroup.find_all_by_workflow_state("deleted").each{|log| log.destroy!}
ContentTag.all.each{|ct| ct.content.try(:destroy!) if ct.context.blank?}
cts_to_delete = []
ContentTag.all.each{|ct| cts_to_delete << ct if ct.content.blank? || ct.context.blank?}
cts_to_delete.each(&:destroy!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment