Commit a51e24d405a6f65df586e3373f5916e5cad1693f

Authored by Thiago Ribeiro
Committed by Rodrigo Souto
1 parent 1c90626d

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>
plugins/organization_ratings/db/migrate/20151203121430_destroy_rejected_reports.rb
... ... @@ -5,7 +5,9 @@ class DestroyRejectedReports &lt; 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(',')})") if comments.present?
  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
... ...