050_add_status_confirmed_field_to_content.rb
上传用户:netsea168
上传日期:2022-07-22
资源大小:4652k
文件大小:0k
源码类别:
Ajax
开发平台:
Others
- class AddStatusConfirmedFieldToContent < ActiveRecord::Migration
- class Content < ActiveRecord::Base
- include BareMigration
- end
- def self.up
- modify_tables_and_update
- [:add_column, Content, :status_confirmed, :boolean] do |a|
- if not $schema_generator
- a.status_confirmed = (a.state =~ /ContentState::(Sp|H)am/ ? true : false)
- a.save!
- end
- end
- end
- def self.down
- remove_column :contents, :status_confirmed
- end
- end