From 93ced61b2a08c657991f145a5997f65cbb90a611 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 19 Jan 2015 21:00:42 +0000 Subject: [PATCH] Fixed #down for migration 20141029181824_remove_issue_statuses_is_default (#18898). Patch by Denis Savitskiy. git-svn-id: http://svn.redmine.org/redmine/trunk@13920 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- db/migrate/20141029181824_remove_issue_statuses_is_default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20141029181824_remove_issue_statuses_is_default.rb b/db/migrate/20141029181824_remove_issue_statuses_is_default.rb index 67a1696c0..62785d37a 100644 --- a/db/migrate/20141029181824_remove_issue_statuses_is_default.rb +++ b/db/migrate/20141029181824_remove_issue_statuses_is_default.rb @@ -6,7 +6,7 @@ class RemoveIssueStatusesIsDefault < ActiveRecord::Migration def down add_column :issue_statuses, :is_default, :boolean, :null => false, :default => false # Restores the first status as default - default_status_id = IssueStatus.order("position").first.pluck(:id) + default_status_id = IssueStatus.order("position").pluck(:id).first IssueStatus.where(:id => default_status_id).update_all(:is_default => true) end end -- 2.39.5