Skip to content

Commit

Permalink
Added new movies
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhruva-K committed Sep 12, 2024
1 parent 2fece66 commit 3fff3e1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3fff3e1

Please sign in to comment.