parent
							
								
									a88becc482
								
							
						
					
					
						commit
						2510631db9
					
				| @ -0,0 +1,4 @@ | ||||
| class ShixunInfo < ActiveRecord::Base | ||||
|   # attr_accessible :title, :body | ||||
|   belongs_to :shixun | ||||
| end | ||||
| @ -0,0 +1,17 @@ | ||||
| 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 | ||||
| @ -0,0 +1,5 @@ | ||||
| FactoryGirl.define do | ||||
|   factory :shixun_info do | ||||
|      | ||||
|   end | ||||
| end | ||||
| @ -0,0 +1,5 @@ | ||||
| require 'rails_helper' | ||||
| 
 | ||||
| RSpec.describe ShixunInfo, :type => :model do | ||||
|   pending "add some examples to (or delete) #{__FILE__}" | ||||
| end | ||||
					Loading…
					
					
				
		Reference in new issue