Merge remote-tracking branch 'origin/develop' into develop

dev_static
杨树明 5 years ago
commit 50b7c9e757

@ -1,6 +1,8 @@
class ModifyCourseGroupForCourses < ActiveRecord::Migration[5.2]
def change
groups = CourseGroup.where(course_id:3429).order("created_at desc").group(:name)
course_ids = [1135, 1208, 1309, 1528, 1563, 1800, 2025, 2086, 2346, 2915, 2917, 2919, 2954, 3064, 3136, 3387, 3423,
3429, 3467, 3651, 3704, 3732]
groups = CourseGroup.where(course_id: course_ids).order("created_at desc").group(:name)
ActiveRecord::Base.transaction do
groups.each do |g|
CourseGroup.where(name: g.name).where.not(id: g.id).each do |cg|
Loading…
Cancel
Save