044_add_published_at_to_content.rb
上传用户:netsea168
上传日期:2022-07-22
资源大小:4652k
文件大小:0k
源码类别:
Ajax
开发平台:
Others
- class AddPublishedAtToContent < ActiveRecord::Migration
- class Content < ActiveRecord::Base
- include BareMigration
- end
- def self.up
- modify_tables_and_update(:add_column, Content,
- :published_at, :datetime) do |content|
- unless $schema_generator
- content.published_at = content.created_at
- end
- end
- end
- def self.down
- remove_column :contents, :published_at
- end
- end