構文が本当に正しいのに、代理店である最初のデータが保存されなかったのはなぜだろうか。
私のシードファイルを見てください:
デシベル/seeds.rb
Agency.delete_all
puts "Creating agency: agency@example.com..."
Agency.create(email: 'agency@example.com', password: 'password')
puts "Done!\n\n"
Admin.delete_all
puts "Creating admin: admin@example.com..."
Admin.new
Admin.create(email: 'admin@example.com', password: 'password')
puts "Done!\n\n"
コンソールに入って叩いたらUser.all
最後のデータのみが保存され、それは「管理者」でした