fix FixHiddenWikiFrontPages migration

Change-Id: I6ce491599c3bbd2ebdd330c468ac0e52ba1a47d4
Reviewed-on: https://gerrit.instructure.com/21615
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
This commit is contained in:
James Williams 2013-06-20 07:59:45 -06:00 committed by Brian Palmer
parent 7c46ae5080
commit 87fd7bdf64
1 changed files with 4 additions and 1 deletions

View File

@ -2,7 +2,10 @@ class FixHiddenWikiFrontPages < ActiveRecord::Migration
tag :postdeploy
def self.up
WikiPage.where(:url => 'front-page', :hide_from_students => true).update_all(:hide_from_students => false)
WikiPage.find_ids_in_ranges do |first, last|
WikiPage.where("url = ? AND hide_from_students = ? AND id >= ? AND id <= ?", 'front-page', true, first, last).
update_all(:hide_from_students => false)
end
end
def self.down