Exclude instagram posts from statuses
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
module Adamantium
|
||||
module Repos
|
||||
class PostRepo < Adamantium::Repo[:posts]
|
||||
Sequel.extension :pg_json
|
||||
Sequel.extension :pg_json_ops
|
||||
commands update: :by_pk
|
||||
|
||||
@@ -97,6 +98,7 @@ module Adamantium
|
||||
def statuses_listing(limit: nil)
|
||||
posts
|
||||
.where(post_type: "post", name: nil)
|
||||
.exclude(Sequel.pg_jsonb_op(:syndication_sources).has_key?("instagram"))
|
||||
.published
|
||||
.combine(:tags)
|
||||
.order(Sequel.desc(:published_at))
|
||||
|
@@ -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
|
Reference in New Issue
Block a user