Fix auto_taging
This commit is contained in:
@@ -33,6 +33,20 @@ module Micropub
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def by_title(title_contains:)
|
||||||
|
posts
|
||||||
|
.where(post_type: "post")
|
||||||
|
.published
|
||||||
|
.where(Sequel.ilike(:name, "%#{title_contains}%")).to_a
|
||||||
|
end
|
||||||
|
|
||||||
|
def by_content(body_contains:)
|
||||||
|
posts
|
||||||
|
.where(post_type: "post")
|
||||||
|
.published
|
||||||
|
.where(Sequel.ilike(:content, "%#{body_contains}%")).to_a
|
||||||
|
end
|
||||||
|
|
||||||
def slug_exists?(slug)
|
def slug_exists?(slug)
|
||||||
!!posts
|
!!posts
|
||||||
.where(slug: slug)
|
.where(slug: slug)
|
||||||
|
Reference in New Issue
Block a user