Permalink
Browse files

heroku db config

  • Loading branch information...
1 parent 972fb43 commit 36367ea63209b27a5dbf8bc54fe0458d57cc139f Marc Peabody committed Dec 18, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 models.rb
View
@@ -6,9 +6,16 @@
'username' => 'root',
'password' => '',
'database' => 'gametrader'
+ },
+ 'production' => {
+ 'adapter' => 'postgresql',
+ 'host' => 'ec2-107-22-181-228.compute-1.amazonaws.com',
+ 'username' => 'kuxjcchuex',
+ 'password' => 'NSdbpkkith7A2vFJgJKp',
+ 'database' => 'kuxjcchuex'
}
}
-config = ActiveRecord::Base.configurations['development']
+config = ActiveRecord::Base.configurations[ENV['RACK_ENV'] || 'development']
begin
ActiveRecord::Base.establish_connection config.merge('database' => 'postgres')
ActiveRecord::Base.connection.create_database(config['database'], config.merge('encoding' => 'utf8'))

0 comments on commit 36367ea

Please sign in to comment.