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:
parent
7c46ae5080
commit
87fd7bdf64
|
@ -2,7 +2,10 @@ class FixHiddenWikiFrontPages < ActiveRecord::Migration
|
||||||
tag :postdeploy
|
tag :postdeploy
|
||||||
|
|
||||||
def self.up
|
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
|
end
|
||||||
|
|
||||||
def self.down
|
def self.down
|
||||||
|
|
Loading…
Reference in New Issue