Commit 8f4a00d12624a74a26dfdf36547d021cc0cc59bb
1 parent
8ac18ed9
Exists in
stable-spb-1.4
and in
8 other branches
Fixing migration
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 | 5 | settings = YAML.load(task['data']) |
6 | 6 | comments << settings[:organization_rating_comment_id] |
7 | 7 | end |
8 | - execute("DELETE FROM comments WHERE id IN (#{comments.join(',')})") | |
8 | + if !comments.empty? | |
9 | + execute("DELETE FROM comments WHERE id IN (#{comments.join(',')})") | |
10 | + end | |
9 | 11 | end |
10 | 12 | |
11 | 13 | def down | ... | ... |