Allow published/approved campaign html variant to be edited (#7045)

This commit is contained in:
Ben Halpern 2020-04-02 16:01:41 -04:00 committed by GitHub
parent abca674c15
commit e97cacef1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,6 +48,7 @@ class HtmlVariant < ApplicationRecord
private
def no_edits
return if group == "campaign"
published_and_approved = (approved && (html_changed? || name_changed? || group_changed?)) && persisted?
errors.add(:base, "cannot change once published and approved") if published_and_approved
end