From bccd5f10d77f2f6772ec27cd6315ddd65e4cb89b Mon Sep 17 00:00:00 2001 From: Jason Denney Date: Sat, 29 Jun 2013 11:45:19 -0400 Subject: [PATCH] Updated seeds.rb for PG --- db/seeds.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/seeds.rb b/db/seeds.rb index 42902a9..f78c7ea 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -15,7 +15,9 @@ end #Load bike brands and models from sql if BikeBrand.all.empty? and BikeModel.all.empty? sql_path = File.join(Rails.root, 'db', 'seed', 'sql', 'bike_brands_and_models.sql') - system "sqlite3 db/development.sqlite3 < #{sql_path}" if Rails.env.development? + db_config = Rails.application.config.database_configuration[Rails.env] + cmd = "psql #{db_config["database"]} < #{sql_path}" + system cmd end if Rails.env.development?