class DefineExcellentCourse < ActiveRecord::Migration def up arr = [302,192,370,394,183,361,117,218,379,178,418,203,342,403,225] for i in 0..arr.length-1 begin puts arr[i] course = Course.find(arr[i]) course.update_attribute(:is_excellent, true) rescue logger.error("Course is not found!") end end end def down end end