From a595a2cd8e03415c97281abe4aa911462e53d117 Mon Sep 17 00:00:00 2001 From: codefactor-io Date: Thu, 26 Dec 2019 03:06:15 +0000 Subject: [PATCH] [CodeFactor] Apply fixes to commit 17fa995 --- db/migrate/20191226024813_crop_harvest_counter_cache.rb | 3 +++ db/migrate/20191226024957_crop_photo_counter_cache.rb | 3 +++ 2 files changed, 6 insertions(+) diff --git a/db/migrate/20191226024813_crop_harvest_counter_cache.rb b/db/migrate/20191226024813_crop_harvest_counter_cache.rb index d0b9c2082..b942bfde3 100644 --- a/db/migrate/20191226024813_crop_harvest_counter_cache.rb +++ b/db/migrate/20191226024813_crop_harvest_counter_cache.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CropHarvestCounterCache < ActiveRecord::Migration[5.2] def change change_table :crops do |t| @@ -7,6 +9,7 @@ class CropHarvestCounterCache < ActiveRecord::Migration[5.2] dir.up { set_counter_value } end end + def set_counter_value execute <<-SQL.squish UPDATE crops diff --git a/db/migrate/20191226024957_crop_photo_counter_cache.rb b/db/migrate/20191226024957_crop_photo_counter_cache.rb index 3bb4ebe68..d4a085e24 100644 --- a/db/migrate/20191226024957_crop_photo_counter_cache.rb +++ b/db/migrate/20191226024957_crop_photo_counter_cache.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CropPhotoCounterCache < ActiveRecord::Migration[5.2] def change change_table :crops do |t| @@ -7,6 +9,7 @@ class CropPhotoCounterCache < ActiveRecord::Migration[5.2] dir.up { set_counter_value } end end + def set_counter_value execute <<-SQL.squish UPDATE crops