Use new hanami db classes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
module Main
|
||||
module Repos
|
||||
class MovieRepo < Adamantium::Repo[:movies]
|
||||
class MovieRepo < Adamantium::DB::Repo[:movies]
|
||||
def listing
|
||||
movies.order(Sequel.lit("year desc")).to_a
|
||||
end
|
||||
|
@@ -1,6 +1,6 @@
|
||||
module Main
|
||||
module Repos
|
||||
class PageRepo < Adamantium::Repo[:pages]
|
||||
class PageRepo < Adamantium::DB::Repo[:pages]
|
||||
def fetch!(slug:)
|
||||
pages
|
||||
.published
|
||||
|
@@ -1,6 +1,6 @@
|
||||
module Main
|
||||
module Repos
|
||||
class PodcastRepo < Adamantium::Repo[:podcasts]
|
||||
class PodcastRepo < Adamantium::DB::Repo[:podcasts]
|
||||
def listing
|
||||
podcasts.order(:name).to_a
|
||||
end
|
||||
|
@@ -1,6 +1,6 @@
|
||||
module Main
|
||||
module Repos
|
||||
class PodcastScrobbleRepo < Adamantium::Repo[:podcast_scrobbles]
|
||||
class PodcastScrobbleRepo < Adamantium::DB::Repo[:podcast_scrobbles]
|
||||
def exists?(id:)
|
||||
!!podcast_scrobbles
|
||||
.where(overcast_id: id)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
module Main
|
||||
module Repos
|
||||
class PostRepo < Adamantium::Repo[:posts]
|
||||
class PostRepo < Adamantium::DB::Repo[:posts]
|
||||
Sequel.extension :pg_json
|
||||
Sequel.extension :pg_json_ops
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
module Main
|
||||
module Repos
|
||||
class PostTagRepo < Adamantium::Repo[:post_tags]
|
||||
class PostTagRepo < Adamantium::DB::Repo[:post_tags]
|
||||
def posts_tagged(tag:)
|
||||
tag_id = post_tags
|
||||
.tags
|
||||
|
@@ -1,6 +1,6 @@
|
||||
module Main
|
||||
module Repos
|
||||
class ReactionRepo < Adamantium::Repo[:reactions]
|
||||
class ReactionRepo < Adamantium::DB::Repo[:reactions]
|
||||
commands :create
|
||||
|
||||
def count(post_id:)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
module Main
|
||||
module Repos
|
||||
class TagRepo < Adamantium::Repo[:tags]
|
||||
class TagRepo < Adamantium::DB::Repo[:tags]
|
||||
def fetch!(slug)
|
||||
tags.where(slug: slug).one!
|
||||
end
|
||||
|
@@ -1,6 +1,6 @@
|
||||
module Main
|
||||
module Repos
|
||||
class TopTrackRepo < Adamantium::Repo[:top_tracks]
|
||||
class TopTrackRepo < Adamantium::DB::Repo[:top_tracks]
|
||||
def for_post(id:)
|
||||
top_tracks
|
||||
.where(post_id: id)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
module Main
|
||||
module Repos
|
||||
class TripRepo < Adamantium::Repo[:trips]
|
||||
class TripRepo < Adamantium::DB::Repo[:trips]
|
||||
def fetch!(id)
|
||||
trips
|
||||
.where(id: id)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
module Main
|
||||
module Repos
|
||||
class WorkoutRepo < Adamantium::Repo[:workouts]
|
||||
class WorkoutRepo < Adamantium::DB::Repo[:workouts]
|
||||
def list
|
||||
workouts.order(:published_at).to_a
|
||||
end
|
||||
|
Reference in New Issue
Block a user