Sha256: ec7d45bab4bb12f03b72b1a6b103ede9bf86460c41d69f06bc91cb98c46c17bc
Contents?: true
Size: 529 Bytes
Versions: 122
Compression:
Stored size: 529 Bytes
Contents
class AddAuthorToComments < ActiveRecord::Migration def up add_column :dorsale_flyboy_task_comments, :author_type, :string if column_exists? :dorsale_flyboy_task_comments, :author_id Dorsale::Flyboy::TaskComment.where("author_id is not null").update_all(author_type: 'User') else add_column :dorsale_flyboy_task_comments, :author_id, :integer end end def down remove_column :dorsale_flyboy_task_comments, :author_id remove_column :dorsale_flyboy_task_comments, :author_type end end
Version data entries
122 entries across 122 versions & 1 rubygems