Updating the Seeds File for Accurate Sample Data
​In this guide we'll walk through how to fix the seed file to work properly with the Audit Log model.
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
Video locked
This video is viewable to users with a Bottega Bootcamp license

Before we move on, it's important that we update our application's sample data. If you open the seeds.rb file, update the audit log creation block to look like this:

# db/seeds.rb

100.times do |audit_log|
  AuditLog.create!(user_id: @user.id, status: 0, start_date: (Date.today - 6.days))
end

puts "100 audit logs have been created"

Now, run:

bundle exec rake db:setup

Our application's sample data should now be setup properly and we can continue to the next guide.

Resources