Exclude instagram posts from statuses

This commit is contained in:
2023-02-28 20:57:56 +11:00
parent 5bee222601
commit a2d3f5efcf
2 changed files with 11 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
module Adamantium module Adamantium
module Repos module Repos
class PostRepo < Adamantium::Repo[:posts] class PostRepo < Adamantium::Repo[:posts]
Sequel.extension :pg_json
Sequel.extension :pg_json_ops Sequel.extension :pg_json_ops
commands update: :by_pk commands update: :by_pk
@@ -97,6 +98,7 @@ module Adamantium
def statuses_listing(limit: nil) def statuses_listing(limit: nil)
posts posts
.where(post_type: "post", name: nil) .where(post_type: "post", name: nil)
.exclude(Sequel.pg_jsonb_op(:syndication_sources).has_key?("instagram"))
.published .published
.combine(:tags) .combine(:tags)
.order(Sequel.desc(:published_at)) .order(Sequel.desc(:published_at))

View File

@@ -0,0 +1,9 @@
# frozen_string_literal: true
ROM::SQL.migration do
change do
alter_table(:posts) do
set_column_type :syndication_sources, :jsonb
end
end
end