diff --git a/app/relations/auto_taggings.rb b/app/relations/auto_taggings.rb index 9234047..7bd604f 100644 --- a/app/relations/auto_taggings.rb +++ b/app/relations/auto_taggings.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class AutoTaggings < ROM::Relation[:sql] + class AutoTaggings < Adamantium::DB::Relation schema :auto_taggings, infer: true do associations do belongs_to :tag diff --git a/app/relations/highlights.rb b/app/relations/highlights.rb index eb8f035..3f29c21 100644 --- a/app/relations/highlights.rb +++ b/app/relations/highlights.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class Highlights < ROM::Relation[:sql] + class Highlights < Adamantium::DB::Relation schema :highlights, infer: true do associations do belongs_to :post diff --git a/app/relations/login_tokens.rb b/app/relations/login_tokens.rb index 3b14146..7f57651 100644 --- a/app/relations/login_tokens.rb +++ b/app/relations/login_tokens.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class LoginTokens < ROM::Relation[:sql] + class LoginTokens < Adamantium::DB::Relation schema :login_tokens, infer: true auto_struct(true) diff --git a/app/relations/movies.rb b/app/relations/movies.rb index 5a443b3..fa09cc4 100644 --- a/app/relations/movies.rb +++ b/app/relations/movies.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class Movies < ROM::Relation[:sql] + class Movies < Adamantium::DB::Relation schema :movies, infer: true auto_struct(true) diff --git a/app/relations/pages.rb b/app/relations/pages.rb index dee595d..49b07cc 100644 --- a/app/relations/pages.rb +++ b/app/relations/pages.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class Pages < ROM::Relation[:sql] + class Pages < Adamantium::DB::Relation schema :pages, infer: true auto_struct(true) diff --git a/app/relations/podcast_scrobbles.rb b/app/relations/podcast_scrobbles.rb index 0404a4b..99edf4c 100644 --- a/app/relations/podcast_scrobbles.rb +++ b/app/relations/podcast_scrobbles.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class PodcastScrobbles < ROM::Relation[:sql] + class PodcastScrobbles < Adamantium::DB::Relation schema :podcast_scrobbles, infer: true auto_struct(true) diff --git a/app/relations/podcasts.rb b/app/relations/podcasts.rb index ba96774..f686579 100644 --- a/app/relations/podcasts.rb +++ b/app/relations/podcasts.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class Podcasts < ROM::Relation[:sql] + class Podcasts < Adamantium::DB::Relation schema :podcasts, infer: true auto_struct(true) diff --git a/app/relations/post_tags.rb b/app/relations/post_tags.rb index 23a1bb2..45bb905 100644 --- a/app/relations/post_tags.rb +++ b/app/relations/post_tags.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class PostTags < ROM::Relation[:sql] + class PostTags < Adamantium::DB::Relation schema :post_tags, infer: true do associations do belongs_to :post diff --git a/app/relations/post_trips.rb b/app/relations/post_trips.rb index 85cb19a..641c60d 100644 --- a/app/relations/post_trips.rb +++ b/app/relations/post_trips.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class PostTrips < ROM::Relation[:sql] + class PostTrips < Adamantium::DB::Relation schema :post_trips, infer: true do associations do belongs_to :post diff --git a/app/relations/posts.rb b/app/relations/posts.rb index 73012c5..91bdd9c 100644 --- a/app/relations/posts.rb +++ b/app/relations/posts.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class Posts < ROM::Relation[:sql] + class Posts < Adamantium::DB::Relation schema :posts, infer: true do associations do has_many :post_tags diff --git a/app/relations/reactions.rb b/app/relations/reactions.rb index 106f300..2fbf71a 100644 --- a/app/relations/reactions.rb +++ b/app/relations/reactions.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class Reactions < ROM::Relation[:sql] + class Reactions < Adamantium::DB::Relation schema :reactions, infer: true do associations do belongs_to :post diff --git a/app/relations/tags.rb b/app/relations/tags.rb index 367f05d..51a879b 100644 --- a/app/relations/tags.rb +++ b/app/relations/tags.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class Tags < ROM::Relation[:sql] + class Tags < Adamantium::DB::Relation schema :tags, infer: true do associations do has_many :post_tags diff --git a/app/relations/top_tracks.rb b/app/relations/top_tracks.rb index ce09983..fdb8918 100644 --- a/app/relations/top_tracks.rb +++ b/app/relations/top_tracks.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class TopTracks < ROM::Relation[:sql] + class TopTracks < Adamantium::DB::Relation schema :top_tracks, infer: true auto_struct(true) diff --git a/app/relations/trips.rb b/app/relations/trips.rb index f400e6b..bb33802 100644 --- a/app/relations/trips.rb +++ b/app/relations/trips.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class Trips < ROM::Relation[:sql] + class Trips < Adamantium::DB::Relation schema :trips, infer: true do associations do has_many :post_trips diff --git a/app/relations/users.rb b/app/relations/users.rb index 34d9257..4a00145 100644 --- a/app/relations/users.rb +++ b/app/relations/users.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class Users < ROM::Relation[:sql] + class Users < Adamantium::DB::Relation schema :users, infer: true auto_struct(true) diff --git a/app/relations/webmentions.rb b/app/relations/webmentions.rb index 6a691b6..0465e98 100644 --- a/app/relations/webmentions.rb +++ b/app/relations/webmentions.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class Webmentions < ROM::Relation[:sql] + class Webmentions < Adamantium::DB::Relation schema :webmentions, infer: true do associations do belongs_to :post diff --git a/app/relations/workouts.rb b/app/relations/workouts.rb index 0f39d4d..1c40d0b 100644 --- a/app/relations/workouts.rb +++ b/app/relations/workouts.rb @@ -2,7 +2,7 @@ module Adamantium module Relations - class Workouts < ROM::Relation[:sql] + class Workouts < Adamantium::DB::Relation schema :workouts, infer: true auto_struct(true) diff --git a/app/repos/page_repo.rb b/app/repos/page_repo.rb index 61f7933..b9d679d 100644 --- a/app/repos/page_repo.rb +++ b/app/repos/page_repo.rb @@ -1,6 +1,6 @@ module Adamantium module Repos - class PageRepo < Adamantium::Repo[:pages] + class PageRepo < Adamantium::DB::Repo[:pages] def fetch!(slug:) pages .published diff --git a/app/repos/podcast_scrobble_repo.rb b/app/repos/podcast_scrobble_repo.rb index 08d93e0..7929d04 100644 --- a/app/repos/podcast_scrobble_repo.rb +++ b/app/repos/podcast_scrobble_repo.rb @@ -1,6 +1,6 @@ module Adamantium module Repos - class PodcastScrobbleRepo < Adamantium::Repo[:podcast_scrobbles] + class PodcastScrobbleRepo < Adamantium::DB::Repo[:podcast_scrobbles] commands :create def exists?(id:) diff --git a/app/repos/post_repo.rb b/app/repos/post_repo.rb index 13ccfcc..e60c196 100644 --- a/app/repos/post_repo.rb +++ b/app/repos/post_repo.rb @@ -2,7 +2,7 @@ require "time_math" module Adamantium module Repos - class PostRepo < Adamantium::Repo[:posts] + class PostRepo < Adamantium::DB::Repo[:posts] def recent(limit:) date = Time.now diff --git a/slices/admin/repos/auto_tagging_repo.rb b/slices/admin/repos/auto_tagging_repo.rb index 858e707..b2a58a7 100644 --- a/slices/admin/repos/auto_tagging_repo.rb +++ b/slices/admin/repos/auto_tagging_repo.rb @@ -1,6 +1,6 @@ module Admin module Repos - class AutoTaggingRepo < Adamantium::Repo[:auto_taggings] + class AutoTaggingRepo < Adamantium::DB::Repo[:auto_taggings] commands :create def find(id) diff --git a/slices/admin/repos/book_repo.rb b/slices/admin/repos/book_repo.rb index fe02755..5ef44c9 100644 --- a/slices/admin/repos/book_repo.rb +++ b/slices/admin/repos/book_repo.rb @@ -1,6 +1,6 @@ module Admin module Repos - class BookRepo < Adamantium::Repo[:posts] + class BookRepo < Adamantium::DB::Repo[:posts] commands :create, update: :by_pk def list_all diff --git a/slices/admin/repos/bookmark_repo.rb b/slices/admin/repos/bookmark_repo.rb index 9472086..3ed4cee 100644 --- a/slices/admin/repos/bookmark_repo.rb +++ b/slices/admin/repos/bookmark_repo.rb @@ -1,6 +1,6 @@ module Admin module Repos - class BookmarkRepo < Adamantium::Repo[:posts] + class BookmarkRepo < Adamantium::DB::Repo[:posts] def list posts .where(post_type: "bookmark") diff --git a/slices/admin/repos/highlight_repo.rb b/slices/admin/repos/highlight_repo.rb index 1e13a47..2ce87d2 100644 --- a/slices/admin/repos/highlight_repo.rb +++ b/slices/admin/repos/highlight_repo.rb @@ -1,6 +1,6 @@ module Admin module Repos - class HighlightRepo < Adamantium::Repo[:highlights] + class HighlightRepo < Adamantium::DB::Repo[:highlights] commands :create, delete: :by_pk def list_all diff --git a/slices/admin/repos/login_tokens_repo.rb b/slices/admin/repos/login_tokens_repo.rb index 3f19701..2fb8d4f 100644 --- a/slices/admin/repos/login_tokens_repo.rb +++ b/slices/admin/repos/login_tokens_repo.rb @@ -1,6 +1,6 @@ module Admin module Repos - class LoginTokensRepo < Adamantium::Repo[:login_tokens] + class LoginTokensRepo < Adamantium::DB::Repo[:login_tokens] commands :create def by_token(token:) diff --git a/slices/admin/repos/movie_repo.rb b/slices/admin/repos/movie_repo.rb index 16c7506..63c55a5 100644 --- a/slices/admin/repos/movie_repo.rb +++ b/slices/admin/repos/movie_repo.rb @@ -1,6 +1,6 @@ module Admin module Repos - class MovieRepo < Adamantium::Repo[:movies] + class MovieRepo < Adamantium::DB::Repo[:movies] commands :create def by_title_and_year(title:, year:) diff --git a/slices/admin/repos/page_repo.rb b/slices/admin/repos/page_repo.rb index eea6131..be0e141 100644 --- a/slices/admin/repos/page_repo.rb +++ b/slices/admin/repos/page_repo.rb @@ -2,7 +2,7 @@ require "time_math" module Admin module Repos - class PageRepo < Adamantium::Repo[:pages] + class PageRepo < Adamantium::DB::Repo[:pages] commands :create, update: :by_pk def list diff --git a/slices/admin/repos/post_repo.rb b/slices/admin/repos/post_repo.rb index 350ca11..d05cd37 100644 --- a/slices/admin/repos/post_repo.rb +++ b/slices/admin/repos/post_repo.rb @@ -2,7 +2,7 @@ require "time_math" module Admin module Repos - class PostRepo < Adamantium::Repo[:posts] + class PostRepo < Adamantium::DB::Repo[:posts] commands update: :by_pk def tag_post(post_id:, tags:) diff --git a/slices/admin/repos/post_tag_repo.rb b/slices/admin/repos/post_tag_repo.rb index 5f13038..90d75dc 100644 --- a/slices/admin/repos/post_tag_repo.rb +++ b/slices/admin/repos/post_tag_repo.rb @@ -1,6 +1,6 @@ module Admin module Repos - class PostTagRepo < Adamantium::Repo[:post_tags] + class PostTagRepo < Adamantium::DB::Repo[:post_tags] def merge_tags(target_id:, source_id:) post_tags.where(tag_id: source_id).update(tag_id: target_id) end diff --git a/slices/admin/repos/post_trip_repo.rb b/slices/admin/repos/post_trip_repo.rb index 1fabb8f..8725480 100644 --- a/slices/admin/repos/post_trip_repo.rb +++ b/slices/admin/repos/post_trip_repo.rb @@ -1,6 +1,6 @@ module Admin module Repos - class PostTripRepo < Adamantium::Repo[:post_trips] + class PostTripRepo < Adamantium::DB::Repo[:post_trips] commands :create def remove(trip_id:, post_id:) diff --git a/slices/admin/repos/tag_repo.rb b/slices/admin/repos/tag_repo.rb index 5c6a5c9..ab10ca2 100644 --- a/slices/admin/repos/tag_repo.rb +++ b/slices/admin/repos/tag_repo.rb @@ -1,6 +1,6 @@ module Admin module Repos - class TagRepo < Adamantium::Repo[:tags] + class TagRepo < Adamantium::DB::Repo[:tags] def list tags .order(Sequel.function(:lower, :label)) diff --git a/slices/admin/repos/trip_repo.rb b/slices/admin/repos/trip_repo.rb index 2a832ed..30a13b0 100644 --- a/slices/admin/repos/trip_repo.rb +++ b/slices/admin/repos/trip_repo.rb @@ -1,6 +1,6 @@ module Admin module Repos - class TripRepo < Adamantium::Repo[:trips] + class TripRepo < Adamantium::DB::Repo[:trips] commands :create def list diff --git a/slices/admin/repos/user_repo.rb b/slices/admin/repos/user_repo.rb index e6ef38b..b8ffe2f 100644 --- a/slices/admin/repos/user_repo.rb +++ b/slices/admin/repos/user_repo.rb @@ -1,6 +1,6 @@ module Admin module Repos - class UserRepo < Adamantium::Repo[:users] + class UserRepo < Adamantium::DB::Repo[:users] commands :create def exists(id) diff --git a/slices/admin/repos/webmention_repo.rb b/slices/admin/repos/webmention_repo.rb index 5a1f768..f8207ad 100644 --- a/slices/admin/repos/webmention_repo.rb +++ b/slices/admin/repos/webmention_repo.rb @@ -1,6 +1,6 @@ module Admin module Repos - class WebmentionRepo < Adamantium::Repo[:webmentions] + class WebmentionRepo < Adamantium::DB::Repo[:webmentions] commands update: :by_pk def list_all_for_check diff --git a/slices/main/repos/movie_repo.rb b/slices/main/repos/movie_repo.rb index 5fcac8c..faeeb52 100644 --- a/slices/main/repos/movie_repo.rb +++ b/slices/main/repos/movie_repo.rb @@ -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 diff --git a/slices/main/repos/page_repo.rb b/slices/main/repos/page_repo.rb index 362b91d..21ec4ec 100644 --- a/slices/main/repos/page_repo.rb +++ b/slices/main/repos/page_repo.rb @@ -1,6 +1,6 @@ module Main module Repos - class PageRepo < Adamantium::Repo[:pages] + class PageRepo < Adamantium::DB::Repo[:pages] def fetch!(slug:) pages .published diff --git a/slices/main/repos/podcast_repo.rb b/slices/main/repos/podcast_repo.rb index 2f55acd..11ba2ce 100644 --- a/slices/main/repos/podcast_repo.rb +++ b/slices/main/repos/podcast_repo.rb @@ -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 diff --git a/slices/main/repos/podcast_scrobble_repo.rb b/slices/main/repos/podcast_scrobble_repo.rb index 58c98f3..ef66f8b 100644 --- a/slices/main/repos/podcast_scrobble_repo.rb +++ b/slices/main/repos/podcast_scrobble_repo.rb @@ -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) diff --git a/slices/main/repos/post_repo.rb b/slices/main/repos/post_repo.rb index 29925fc..4d8f38e 100644 --- a/slices/main/repos/post_repo.rb +++ b/slices/main/repos/post_repo.rb @@ -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 diff --git a/slices/main/repos/post_tag_repo.rb b/slices/main/repos/post_tag_repo.rb index 83d3d5f..614bcf7 100644 --- a/slices/main/repos/post_tag_repo.rb +++ b/slices/main/repos/post_tag_repo.rb @@ -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 diff --git a/slices/main/repos/reaction_repo.rb b/slices/main/repos/reaction_repo.rb index e4eba5e..9531606 100644 --- a/slices/main/repos/reaction_repo.rb +++ b/slices/main/repos/reaction_repo.rb @@ -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:) diff --git a/slices/main/repos/tag_repo.rb b/slices/main/repos/tag_repo.rb index 0626e74..bb00704 100644 --- a/slices/main/repos/tag_repo.rb +++ b/slices/main/repos/tag_repo.rb @@ -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 diff --git a/slices/main/repos/top_track_repo.rb b/slices/main/repos/top_track_repo.rb index d7c952b..0e1d483 100644 --- a/slices/main/repos/top_track_repo.rb +++ b/slices/main/repos/top_track_repo.rb @@ -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) diff --git a/slices/main/repos/trip_repo.rb b/slices/main/repos/trip_repo.rb index 8b0a1f8..d62c315 100644 --- a/slices/main/repos/trip_repo.rb +++ b/slices/main/repos/trip_repo.rb @@ -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) diff --git a/slices/main/repos/workout_repo.rb b/slices/main/repos/workout_repo.rb index 30cab78..900b59c 100644 --- a/slices/main/repos/workout_repo.rb +++ b/slices/main/repos/workout_repo.rb @@ -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 diff --git a/slices/micropub/repos/auto_tagging_repo.rb b/slices/micropub/repos/auto_tagging_repo.rb index ea13d6b..294ce45 100644 --- a/slices/micropub/repos/auto_tagging_repo.rb +++ b/slices/micropub/repos/auto_tagging_repo.rb @@ -1,6 +1,6 @@ module Micropub module Repos - class AutoTaggingRepo < Adamantium::Repo[:auto_taggings] + class AutoTaggingRepo < Adamantium::DB::Repo[:auto_taggings] def find(id) auto_taggings .where(id: id) diff --git a/slices/micropub/repos/movie_repo.rb b/slices/micropub/repos/movie_repo.rb index 204d757..78df32f 100644 --- a/slices/micropub/repos/movie_repo.rb +++ b/slices/micropub/repos/movie_repo.rb @@ -1,6 +1,6 @@ module Micropub module Repos - class MovieRepo < Adamantium::Repo[:movies] + class MovieRepo < Adamantium::DB::Repo[:movies] commands :create end end diff --git a/slices/micropub/repos/podcast_repo.rb b/slices/micropub/repos/podcast_repo.rb index e9d7fba..e54c6c2 100644 --- a/slices/micropub/repos/podcast_repo.rb +++ b/slices/micropub/repos/podcast_repo.rb @@ -1,6 +1,6 @@ module Micropub module Repos - class PodcastRepo < Adamantium::Repo[:podcasts] + class PodcastRepo < Adamantium::DB::Repo[:podcasts] commands :create def listing diff --git a/slices/micropub/repos/post_repo.rb b/slices/micropub/repos/post_repo.rb index 7d820cd..ae19388 100644 --- a/slices/micropub/repos/post_repo.rb +++ b/slices/micropub/repos/post_repo.rb @@ -1,6 +1,6 @@ module Micropub module Repos - class PostRepo < Adamantium::Repo[:posts] + class PostRepo < Adamantium::DB::Repo[:posts] commands update: :by_pk def remove_tag(post_id:, tag:) diff --git a/slices/micropub/repos/webmentions_repo.rb b/slices/micropub/repos/webmentions_repo.rb index 1d78cb2..74c5f8e 100644 --- a/slices/micropub/repos/webmentions_repo.rb +++ b/slices/micropub/repos/webmentions_repo.rb @@ -1,6 +1,6 @@ module Micropub module Repos - class WebmentionsRepo < Adamantium::Repo[:webmentions] + class WebmentionsRepo < Adamantium::DB::Repo[:webmentions] commands :create end end diff --git a/slices/micropub/repos/workout_repo.rb b/slices/micropub/repos/workout_repo.rb index 734eefd..a332ad7 100644 --- a/slices/micropub/repos/workout_repo.rb +++ b/slices/micropub/repos/workout_repo.rb @@ -1,6 +1,6 @@ module Micropub module Repos - class WorkoutRepo < Adamantium::Repo[:workouts] + class WorkoutRepo < Adamantium::DB::Repo[:workouts] commands :create, update: :by_pk end end diff --git a/spec/requests/create_webmention_spec.rb b/spec/requests/create_webmention_spec.rb index 36a87fe..2899346 100644 --- a/spec/requests/create_webmention_spec.rb +++ b/spec/requests/create_webmention_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true RSpec.describe "Webmention creation", :db, :requests do - let(:post_repo) { Adamantium::Repos::PostRepo.new } + let(:post_repo) { Adamantium::DB::Repos::PostRepo.new } let(:post_record) { Test::Factory[:post] } context "reply" do