Commit a51e24d4 authored by Thiago Ribeiro's avatar Thiago Ribeiro Committed by Rodrigo Souto

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's avatarGustavo Coelho <[email protected]>
parent 1c90626d
Pipeline #635431 failed with stage
......@@ -5,7 +5,9 @@ class DestroyRejectedReports < ActiveRecord::Migration
settings = YAML.load(task['data'])
comments << settings[:organization_rating_comment_id]
execute("DELETE FROM comments WHERE id IN (#{comments.join(',')})") if comments.present?
if !comments.empty?
execute("DELETE FROM comments WHERE id IN (#{comments.join(',')})")
def down
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment