diff --git a/db/seeds.rb b/db/seeds.rb index 62badca..4729667 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -9,9 +9,20 @@ { title: 'Nomadland', rating: 'R', release_date: '19-Feb-2021' }, { title: 'CODA', rating: 'PG-13', - release_date: '13-Aug-2021' } + release_date: '13-Aug-2021' }, + { title: 'Batman Begins', rating: 'PG-13', + release_date: '07-Aug-2008' }, + { title: 'Joker', rating: 'R', + release_date: '13-Nov-2021' }, + { title: 'Avatar 2', rating: 'PG-13', + release_date: '21-Dec-2023' }, + { title: 'Deadpool 2', rating: 'PG-13', + release_date: '21-Jul-2024' } ] more_movies.each do |movie| - Movie.create!(movie) + Movie.find_or_create_by!(title: movie[:title]) do |m| + m.rating = movie[:rating] + m.release_date = movie[:release_date] + end end