Use new hanami db classes

This commit is contained in:
2024-08-05 18:44:20 +10:00
parent d7573d7038
commit 2ada50cbcd
52 changed files with 52 additions and 52 deletions

View File

@@ -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

View File

@@ -1,6 +1,6 @@
module Main
module Repos
class PageRepo < Adamantium::Repo[:pages]
class PageRepo < Adamantium::DB::Repo[:pages]
def fetch!(slug:)
pages
.published

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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:)

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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