desc “Populate database for first time based on export from AS/400
system”
task :populate_from_export do
ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations[‘development’])
User.find(:all)
puts “hello world”
end
end
I want to be able to call User.find(:all) from my rake task but I am
getting the following error:
development database is not configured
If I get rid of the first line of the task I get the following error:
ActiveRecord::ConnectionNotEstablished
So how do I make a proper conneection and make my models accessible to
me for a rake task?