From 878fc7ebcd99051a2c60ec26527e355d4ef9ffe1 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 6 Dec 2017 14:17:34 +1300 Subject: [PATCH] Use symbol procs --- .rubocop_todo.yml | 7 ------- lib/tasks/growstuff.rake | 8 ++------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index b4c4130f6..e5d301c5c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -160,13 +160,6 @@ Style/RegexpLiteral: - 'spec/views/members/index.html.haml_spec.rb' - 'spec/views/posts/index.html.haml_spec.rb' -# Cop supports --auto-correct. -# Configuration parameters: IgnoredMethods. -# IgnoredMethods: respond_to, define_method -Style/SymbolProc: - Exclude: - - 'lib/tasks/growstuff.rake' - # Cop supports --auto-correct. # Configuration parameters: SupportedStyles, WordRegex. # SupportedStyles: percent, brackets diff --git a/lib/tasks/growstuff.rake b/lib/tasks/growstuff.rake index f0c22aeeb..02827e126 100644 --- a/lib/tasks/growstuff.rake +++ b/lib/tasks/growstuff.rake @@ -276,16 +276,12 @@ namespace :growstuff do desc "October 2014: remove unused photos" task remove_unused_photos: :environment do - Photo.find_each do |p| - p.destroy_if_unused - end + Photo.find_each(&:destroy_if_unused) end desc "October 2014: generate crops_posts records for existing posts" task generate_crops_posts_records: :environment do - Post.find_each do |p| - p.save - end + Post.find_each(&:save) end desc "October 2014: add alternate names for crops"