Skip to content

Instantly share code, notes, and snippets.

@rjswenson
Created November 6, 2018 15:45
Show Gist options
  • Save rjswenson/0d52f18f35aee3cca9ecb7a72d260073 to your computer and use it in GitHub Desktop.
Save rjswenson/0d52f18f35aee3cca9ecb7a72d260073 to your computer and use it in GitHub Desktop.
Majestic remove S/A images for some Headwear
arr = ["198J-AJZ", "196T-9GI", "196W-9GY", "197A-9HP", "197B-9HV", "197C-9IA", "197R-9IY", "197D-9IB", "197E-9ID", "197S-9IZ", "197T-9J1", "197F-9IE", "197H-9IH", "197Z-A6G", "197U-9J5", "197V-9J6", "198C-9KV", "198D-9KY", "198K-9KZ", "198E-9L8", "198H-9LM"]
arr.each do |str|
p str
Image.where(original_filename: /.*#{str}_.*(?!87).*[SA]_01.png/).each do |img|
img.delete
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment