parent
63f9a3cac1
commit
71300897a5
@ -1,4 +0,0 @@
|
|||||||
class ShixunInfo < ActiveRecord::Base
|
|
||||||
# attr_accessible :title, :body
|
|
||||||
belongs_to :shixun
|
|
||||||
end
|
|
@ -1,17 +0,0 @@
|
|||||||
class AddEvaluateScriptAndDescriptionForShixuns < ActiveRecord::Migration
|
|
||||||
def up
|
|
||||||
add_column :shixuns, :evaluate_script, :text
|
|
||||||
add_column :shixuns, :description, :text
|
|
||||||
add_column :shixuns, :propaedeutics, :text
|
|
||||||
|
|
||||||
shixuns = Shixun.where(nil).unscoped
|
|
||||||
shixuns.find_each do |shixun|
|
|
||||||
shixun.update_attributes(evaluate_script: shixun.shixun_info.try(:evaluate_script),
|
|
||||||
description: shixun.shixun_info.try(:description),
|
|
||||||
propaedeutics: shixun.shixun_info.try(:description))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def down
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in new issue