Remove unnecessary sanitising

Existing descriptions have been sanitised in a migration. New
descriptions are sanitised when assigned. That should cover everything.
This commit is contained in:
Maikel Linke
2024-09-05 12:38:33 +10:00
parent 53286c22ba
commit d061fe8ad9
2 changed files with 0 additions and 10 deletions

View File

@@ -247,11 +247,6 @@ class Enterprise < ApplicationRecord
count(distinct: true)
end
# Remove any unsupported HTML.
def long_description
HtmlSanitizer.sanitize(super)
end
# Remove any unsupported HTML.
def long_description=(html)
super(HtmlSanitizer.sanitize(html))

View File

@@ -404,11 +404,6 @@ RSpec.describe Enterprise do
subject.long_description = "Hello <script>alert</script> dearest <b>monster</b>."
expect(subject.long_description).to eq "Hello alert dearest <b>monster</b>."
end
it "sanitises existing HTML in long_description" do
subject[:long_description] = "Hello <script>alert</script> dearest <b>monster</b>."
expect(subject.long_description).to eq "Hello alert dearest <b>monster</b>."
end
end
describe "callbacks" do