From a307d5f6d5984862bf2b1eb09322900c467ed7e4 Mon Sep 17 00:00:00 2001 From: Jason Denney Date: Sat, 8 Dec 2012 15:00:24 -0500 Subject: [PATCH] Load bike brands and models into sqlite3, This will work for now --- db/seeds.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db/seeds.rb b/db/seeds.rb index e1d1d40..29f6ac0 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -12,6 +12,12 @@ Dir.glob(File.join(Rails.root, 'db', 'seed', 'fixtures', '**', '*.{yml,csv}')).e ActiveRecord::Fixtures.create_fixtures(File.dirname(fixture_file), File.basename(fixture_file, '.*')) end +#Load bike brands and models from sql +if + 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? +end + if Rails.env.development? user = FactoryGirl.build(:user) FactoryGirl.create(:user) if not User.find_by_email(user.email)