Sha256: 5be04b7231082ce0bc8f5a868b4e4c7889ec3403a57dc02f27e1dd692547c25c
Contents?: true
Size: 568 Bytes
Versions: 29
Compression:
Stored size: 568 Bytes
Contents
class ChangeLiquidTagsToPolymorphic < ActiveRecord::Migration def up rename_column :spud_page_liquid_tags, :spud_page_partial_id, :attachment_id add_column :spud_page_liquid_tags, :attachment_type, :string add_index :spud_page_liquid_tags, [:attachment_type,:attachment_id] SpudPageLiquidTag.all.each do |f| f.update_attributes(:attachment_type => "SpudPagePartial") end end def down rename_column :spud_page_liquid_tags, :attachment_id, :spud_page_partial_id remove_column :spud_page_liquid_tags, :attachment_type end end
Version data entries
29 entries across 29 versions & 2 rubygems