diff --git a/db/seeds.rb b/db/seeds.rb index e605943..bcc1fe8 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -5,7 +5,15 @@ # # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel', city: cities.first) +require 'active_record/fixtures' + +Dir.glob(File.join(Rails.root, 'test', 'fixtures', '**/*.{yml,csv}')).each do |fixture_file, something| + puts fixture_file + puts File.dirname(fixture_file) + ActiveRecord::Fixtures.create_fixtures(File.dirname(fixture_file), File.basename(fixture_file, '.*')) +end if Rails.env.development? - FactoryGirl.create(:user) + user = FactoryGirl.build(:user) + FactoryGirl.create(:user) if not User.find_by_email(user.email) end diff --git a/test/fixtures/acts_as_loggable/bike_actions.yml b/test/fixtures/acts_as_loggable/bike_actions.yml index bdfc531..c64121b 100644 --- a/test/fixtures/acts_as_loggable/bike_actions.yml +++ b/test/fixtures/acts_as_loggable/bike_actions.yml @@ -1,15 +1,25 @@ acquired: id: 1 action: ACQUIRED + created_at: <%= Time.now %> + updated_at: <%= Time.now %> scrapped: id: 2 action: SCRAPPED + created_at: <%= Time.now %> + updated_at: <%= Time.now %> worked: id: 3 action: WORKED + created_at: <%= Time.now %> + updated_at: <%= Time.now %> completed: id: 4 action: COMPLETED + created_at: <%= Time.now %> + updated_at: <%= Time.now %> sold: id: 5 action: SOLD + created_at: <%= Time.now %> + updated_at: <%= Time.now %>