From 3a07e85c4d17f6670998188417205395f6857a67 Mon Sep 17 00:00:00 2001 From: Remi Rampin Date: Mon, 7 Jan 2019 02:14:53 -0500 Subject: [PATCH] Fix db/seeds.rb (#9738) Add "agreement: true" to avoid: > ActiveRecord::RecordInvalid: Validation failed: Agreement must be accepted --- db/seeds.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/seeds.rb b/db/seeds.rb index 6adfeed8d..cf62ebf39 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -4,5 +4,5 @@ if Rails.env.development? domain = ENV['LOCAL_DOMAIN'] || Rails.configuration.x.local_domain admin = Account.where(username: 'admin').first_or_initialize(username: 'admin') admin.save(validate: false) - User.where(email: "admin@#{domain}").first_or_initialize(email: "admin@#{domain}", password: 'mastodonadmin', password_confirmation: 'mastodonadmin', confirmed_at: Time.now.utc, admin: true, account: admin).save! + User.where(email: "admin@#{domain}").first_or_initialize(email: "admin@#{domain}", password: 'mastodonadmin', password_confirmation: 'mastodonadmin', confirmed_at: Time.now.utc, admin: true, account: admin, agreement: true).save! end