Skip to content

Instantly share code, notes, and snippets.

@irvingpop
Last active August 29, 2015 14:01
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 irvingpop/7cb611bda2385a71d3aa to your computer and use it in GitHub Desktop.
Save irvingpop/7cb611bda2385a71d3aa to your computer and use it in GitHub Desktop.
Stupid Orgmapper Tricks
org_guids = ORGS.all.map {|o| o.guid}
sql.select(:checksum, :org_id).from(:nodes).exclude(:org_id => org_guids)
# sql.select(:checksum, :org_id).from(:nodes).exclude(:org_id => org_guids).delete
sql.select(:checksum, :org_id).from(:cookbook_version_checksums).exclude(:org_id => org_guids)
# sql.select(:checksum, :org_id).from(:cookbook_version_checksums).exclude(:org_id => org_guids).delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment