add options for modifying commentary/commentary_request tags on form #2623

This commit is contained in:
r888888888
2016-07-19 16:49:04 -07:00
parent 37bc7279e3
commit 35a6f60dc4
4 changed files with 68 additions and 3 deletions

View File

@@ -754,6 +754,14 @@ class Post < ActiveRecord::Base
!!(tag_string =~ /(?:^| )(?:#{tag})(?:$| )/)
end
def add_tag(tag)
set_tag_string("#{tag_string} #{tag}")
end
def remove_tag(tag)
set_tag_string((tag_array - tag).join(" "))
end
def has_dup_tag?
has_tag?("duplicate")
end