mirror of
https://github.com/fspc/BikeShed-1.git
synced 2025-04-04 05:33:22 -04:00
Updated seeds.rb for PG
This commit is contained in:
parent
f0ce8b7171
commit
bccd5f10d7
@ -15,7 +15,9 @@ end
|
|||||||
#Load bike brands and models from sql
|
#Load bike brands and models from sql
|
||||||
if BikeBrand.all.empty? and BikeModel.all.empty?
|
if BikeBrand.all.empty? and BikeModel.all.empty?
|
||||||
sql_path = File.join(Rails.root, 'db', 'seed', 'sql', 'bike_brands_and_models.sql')
|
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
|
end
|
||||||
|
|
||||||
if Rails.env.development?
|
if Rails.env.development?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user