Commit a51e24d405a6f65df586e3373f5916e5cad1693f
Committed by
Rodrigo Souto
1 parent
1c90626d
Exists in
master
and in
17 other branches
Fixing migration 20151203121430
Checking if comments is empty before execute delete statement because the clause IN has to have a argument. Signed-off-by: Gustavo Coelho <gust.rod.coelho@gmail.com>
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
plugins/organization_ratings/db/migrate/20151203121430_destroy_rejected_reports.rb
@@ -5,7 +5,9 @@ class DestroyRejectedReports < ActiveRecord::Migration | @@ -5,7 +5,9 @@ class DestroyRejectedReports < ActiveRecord::Migration | ||
5 | settings = YAML.load(task['data']) | 5 | settings = YAML.load(task['data']) |
6 | comments << settings[:organization_rating_comment_id] | 6 | comments << settings[:organization_rating_comment_id] |
7 | end | 7 | end |
8 | - execute("DELETE FROM comments WHERE id IN (#{comments.join(',')})") if comments.present? | 8 | + if !comments.empty? |
9 | + execute("DELETE FROM comments WHERE id IN (#{comments.join(',')})") | ||
10 | + end | ||
9 | end | 11 | end |
10 | 12 | ||
11 | def down | 13 | def down |