Tag merging UI
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user