For whatever reason I’m getting the following when attempting to run a
migration:
–rename_column(:listings, :listed_by, :agent_id)
rake aborted!
You have a nil object when you didn’t expect it!
The error occured while evaluating nil.to_sym
The migration itself looks like this:
class CorrectColumnType < ActiveRecord::Migration
def self.up
rename_column :listings, :listed_by, :agent_id
end
def self.down
rename_column :listings, :agent_id, :listed_by
end
end
The table ‘listings’ and column ‘listed_by’ do exist and the code
makes use of it fine–I just want to rename that column and can’t.
Any ideas why?