078_add_textfilter_to_users.rb
上传用户:netsea168
上传日期:2022-07-22
资源大小:4652k
文件大小:0k
源码类别:
Ajax
开发平台:
Others
- class AddTextfilterToUsers < ActiveRecord::Migration
- def self.up
- f = TextFilter.find(:first, :conditions => ["name = ?", "none"])
- add_column :users, :text_filter_id, :string, :default => f.id
- unless Blog.default.nil?
- t = TextFilter.find(:first, :conditions => "name= '#{Blog.default.text_filter}'")
- User.update_all("text_filter_id = #{t.id}")
- end
- end
- def self.down
- remove_column :text_filter_id, :integer
- end
- end