Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AddTranslationTableToBlog < ActiveRecord::Migration
- def self.up
- BlogPost.create_translation_table!({
- :title => :string,
- :body => :text,
- :custom_teaser => :text
- }, :migrate_data => true)
- # Not sure if needed... thought maybe might prevent it from squawking...
- ::BlogPost::Translation.module_eval do
- is_seo_meta
- end
- ::SeoMetum.update_all :seo_meta_type => 'BlogPost::Translation', :seo_meta_type => 'BlogPost'
- remove_column :blog_posts, :title
- remove_column :blog_posts, :body
- remove_column :blog_posts, :custom_teaser
- BlogCategory.create_translation_table!({
- :title => :string
- }, :migrate_data => true)
- remove_column :blog_categories, :title
- end
- def self.down
- # ...
- end
- end
Add Comment
Please, Sign In to add comment