Skip to content

Instantly share code, notes, and snippets.

@laser
Last active August 29, 2015 13:55
Show Gist options
  • Save laser/8691020 to your computer and use it in GitHub Desktop.
Save laser/8691020 to your computer and use it in GitHub Desktop.
Asset Service
class AssetService
def prune_stale_images
Prunable.from_assets(Image.all).each do |image|
S3Object.delete image.s3_object_name, image.s3_bucket_name
image.destroy
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment