From 933fd9ac461945d56f808760c28c74509734f893 Mon Sep 17 00:00:00 2001 From: Krzysztof Kotlarek Date: Mon, 7 Sep 2020 10:46:46 +1000 Subject: [PATCH] FIX: rubocop in fix query ids migration --- db/migrate/20200902225712_fix_query_ids.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/migrate/20200902225712_fix_query_ids.rb b/db/migrate/20200902225712_fix_query_ids.rb index f75b07e..28f5197 100644 --- a/db/migrate/20200902225712_fix_query_ids.rb +++ b/db/migrate/20200902225712_fix_query_ids.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class FixQueryIds < ActiveRecord::Migration[6.0] def up ActiveRecord::Base.transaction do @@ -17,7 +19,7 @@ class FixQueryIds < ActiveRecord::Migration[6.0] # If there are new queries, they still may have conflict # We just want to move their ids to safe space and we will not move them back - additional_conflicts = DB.query(<<~SQL, from: movements.map{ |m| m.from }, to: movements.map { |m| m.to } ).map { |conflict| conflict.id } + additional_conflicts = DB.query(<<~SQL, from: movements.map { |m| m.from }, to: movements.map { |m| m.to }).map { |conflict| conflict.id } SELECT id FROM data_explorer_queries WHERE id IN (:to) AND id NOT IN (:from) @@ -37,8 +39,6 @@ class FixQueryIds < ActiveRecord::Migration[6.0] ) SQL - - movements.each do |movement| # insert moved and conflict queries to temporary table DB.exec <<-SQL