In one of my migration files I have the following:
===========
def self.up
User.create :name => ‘John K.’, :email =>
‘[email protected]’, :password => ‘test’
end
When I run it I get the following error:
===========
undefined method `create’ for
#ActiveRecord::ConnectionAdapters::MysqlAdapter:0x2345c1c
When I copy the line and paste it in console it works perfectly.
Even using the longer method of
===========
user = User.new
user.name
user.save
Does not work in the migration. Tells me method name does not
exist. It exists.
Anyone have any insight about this. Problem has been driving me
crazy for the last 30 minutes.
Your Friend
John K.