<commit_before>namespace :images do

  desc "Regenerate all thumbnails. Useful for when you've changed size or cropping on the images after images have been uploaded."
  task :regenerate => :environment do
    thumbnails_size = Image.count :conditions => {:parent_id => !nil}
    puts "Preparing to delete #{thumbnails_size} generated thumbnails"
        
    if Image.destroy_all("parent_id IS NOT null")
      puts "--> #{thumbnails_size} thumbnails deleted"
    else
      puts "There may have been a problem deleting the thumbnails."
    end
    <commit_msg>turns out this syntax provides more accurate results and it is probably easier to read<commit_after>namespace :images do

  desc "Regenerate all thumbnails. Useful for when you've changed size or cropping on the images after images have been uploaded."
  task :regenerate => :environment do
    thumbnails_size = Image.count(:conditions => "parent_id IS NOT NULL")
    puts "Preparing to delete #{thumbnails_size} generated thumbnails"
        
    if Image.destroy_all("parent_id IS NOT null")
      puts "--> #{thumbnails_size} thumbnails deleted"
    else
      puts "There may have been a problem deleting the thumbnails."
    end
    
{'fraction_non_alphanumeric': 0.07327227310574522, 'fraction_numerical': 0.0, 'mean_word_length': 3.640926640926641, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1550915', 'n_tokens_mistral': 339, 'n_tokens_neox': 331, 'n_words': 135}