I have the folowing migration but don't know what to use in the down method
change_table :addresses do |t|
  t.references :addressable, :polymorphic => true
end
I have the folowing migration but don't know what to use in the down method
change_table :addresses do |t|
  t.references :addressable, :polymorphic => true
end
actually,
   change_table :addresses do |t|
     t.remove_references :addressable
   end
would be a bit railsier, no?
edit: As Eben Geer points out
   change_table :addresses do |t|
     t.remove_references :addressable, :polymorphic => true
   end
is the correct way to do this. Cheers!
 
    
    class RemoveAddressableFromAddresses < ActiveRecord::Migration
  def change
    remove_reference :addresses, :addressable, polymorphic: true, index: true
  end
end
 
    
    def self.down
  change_table :addresses do |t|
    t.remove_references :addressable, :polymorphic => true
  end
end
 
    
    What's the problem?
def self.down
  remove_column :addresses, :addressable_type
  remove_column :addresses, :addressable_id
end
 
    
    What's wrong with this?
def self.down
  remove_column :addresses, :addressable
end
