Sha256: 436cebe3f72c537a5cc819266bf36d56d0c9e3308295454e03eb223e2fd93a63
Contents?: true
Size: 405 Bytes
Versions: 122
Compression:
Stored size: 405 Bytes
Contents
class AddPolymorphicUsersToComments < ActiveRecord::Migration def up rename_column :dorsale_comments, :user_id, :author_id add_column :dorsale_comments, :author_type, :string Dorsale::Comment.where("author_id is not null").update_all(author_type: 'User') end def down rename_column :dorsale_comments, :author_id, :user_id remove_column :dorsale_comments, :author_type end end
Version data entries
122 entries across 122 versions & 1 rubygems