diff --git a/app/models/artist_commentary.rb b/app/models/artist_commentary.rb index ed952bff4..5d8a59885 100644 --- a/app/models/artist_commentary.rb +++ b/app/models/artist_commentary.rb @@ -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 diff --git a/test/unit/artist_commentary_test.rb b/test/unit/artist_commentary_test.rb index 09a7df47e..74c7e0ebd 100644 --- a/test/unit/artist_commentary_test.rb +++ b/test/unit/artist_commentary_test.rb @@ -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)