This commit is contained in:
caishi 2018-02-07 14:14:31 +08:00
parent a38c68a791
commit fb5e59093a
2 changed files with 2720 additions and 3382 deletions

View File

@ -1,5 +1,6 @@
class AddAttachmentsToCourses < ActiveRecord::Migration class AddAttachmentsToCourses < ActiveRecord::Migration
def change def change
=begin
Course.where(:id => CourseActivity.where("updated_at > '2017-06-01 00:00:00'").map(&:course_id).uniq).each do |course| Course.where(:id => CourseActivity.where("updated_at > '2017-06-01 00:00:00'").map(&:course_id).uniq).each do |course|
attachments = Attachment.where(:container_type => 'Course', :container_id => course.syllabus.courses.map(&:id)) attachments = Attachment.where(:container_type => 'Course', :container_id => course.syllabus.courses.map(&:id))
attachments.each do |attachment| attachments.each do |attachment|
@ -33,5 +34,6 @@ class AddAttachmentsToCourses < ActiveRecord::Migration
end end
end end
end end
=end
end end
end end

File diff suppressed because it is too large Load Diff