Validate bookmark URL uniqueness

This commit is contained in:
2024-03-01 20:52:30 +11:00
parent 0f9b9c6248
commit 32411b76ef
3 changed files with 33 additions and 0 deletions

View File

@@ -53,6 +53,12 @@ module Micropub
.one
end
def url_exists?(url)
!!posts
.where(url: url)
.one
end
def find!(id)
posts
.by_pk(id)