Tag merging UI

This commit is contained in:
2023-05-07 22:15:37 +10:00
parent 9ef9eda41c
commit 8038da9107
14 changed files with 154 additions and 4 deletions

View File

@@ -1,7 +1,13 @@
require 'pry'
module Admin
module Repos
class PostTagRepo < Adamantium::Repo[:post_tags]
def merge_tags(target_id:, source_id:)
post_tags.where(tag_id: source_id).update(tag_id: target_id)
end
def delete(tag_id:)
post_tags.where(tag_id: tag_id).delete
end

View File

@@ -16,6 +16,10 @@ module Admin
def delete(tag_id:)
tags.by_pk(tag_id).delete
end
def fetch(id)
tags.by_pk(id).one
end
end
end
end