Fix #3641: Can't add tags via Add Commentary dialog.

This commit is contained in:
evazion
2018-04-16 12:10:54 -05:00
parent 2c46191f99
commit e49e6f49bb
2 changed files with 6 additions and 1 deletions

View File

@@ -108,7 +108,7 @@ class ArtistCommentary < ApplicationRecord
post.add_tag("check_commentary")
end
post.save if post.saved_change_to_tag_string?
post.save if post.tag_string_changed?
end
module VersionMethods

View File

@@ -60,6 +60,11 @@ class ArtistCommentaryTest < ActiveSupport::TestCase
@artcomm.reload
end
should "add tags if requested" do
@artcomm.update(translated_title: "bar", add_commentary_tag: "1")
assert_equal(true, @post.reload.has_tag?("commentary"))
end
should "not create new version if nothing changed" do
@artcomm.save
assert_equal(1, @post.artist_commentary.versions.size)