Add movies page
This commit is contained in:
15
app/repos/movie_repo.rb
Normal file
15
app/repos/movie_repo.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
module Adamantium
|
||||
module Repos
|
||||
class MovieRepo < Adamantium::Repo[:movies]
|
||||
commands :create
|
||||
|
||||
def listing
|
||||
movies.order(Sequel.lit("year desc")).to_a
|
||||
end
|
||||
|
||||
def by_title_and_year(title:, year:)
|
||||
movies.where(title: title, year: year).one
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user