Sha256: c587ccbe3b8865c4f6bc2281e2b661882a1716d6233a3c7c4a9c03fba48a789e
Contents?: true
Size: 534 Bytes
Versions: 12
Compression:
Stored size: 534 Bytes
Contents
class ChangePostsPropertiesToHaveDefaults < ActiveRecord::Migration def change Blogelator::Post.all.each do |post| post.title = post.title.to_s post.body_html = post.body_html.to_s post.body_markdown = post.body_markdown.to_s post.save end change_column :blogelator_posts, :title, :string, default: "", null: false change_column :blogelator_posts, :body_html, :text, default: "", null: false change_column :blogelator_posts, :body_markdown, :text, default: "", null: false end end
Version data entries
12 entries across 12 versions & 1 rubygems