Merge branch 'develop' of http://git.trustie.net/jacknudt/trustieforge into develop
commit
20b2430da9
@ -0,0 +1,19 @@
|
||||
class UpdateCourseTerm < ActiveRecord::Migration
|
||||
def up
|
||||
count = Course.all.count / 30 + 2
|
||||
transaction do
|
||||
for i in 1 ... count do i
|
||||
Course.page(i).per(30).each do |course|
|
||||
if course.end_time.nil? && course.end_term.nil?
|
||||
course.end_time = course.time
|
||||
course.end_term = course.term
|
||||
course.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
@ -0,0 +1,21 @@
|
||||
class AddPublishToAttachments < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :attachments, :is_publish, :integer, :default => 1
|
||||
add_column :attachments, :publish_time, :date
|
||||
=begin
|
||||
count = Attachment.all.count / 30 + 2
|
||||
transaction do
|
||||
for i in 1 ... count do i
|
||||
Attachment.page(i).per(30).each do |atta|
|
||||
begin
|
||||
atta.publish_time = atta.created_on.strftime('%d-%b-%Y')
|
||||
atta.save
|
||||
ensure
|
||||
logger.error("===================>>container_id is null")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
=end
|
||||
end
|
||||
end
|
Loading…
Reference in new issue