activerecord_html_stripper 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDU1MjdkYTJlYmMwMzA1ZGNmNzAwNTE4MGYwNzQ3OTZkM2VlNjc4OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjUyNGExOGE4MzE4YjQ4ZTA2YWM3NDMxZGFiMmVkMWRkYjNjNWQ1OQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTllODFmNzUwYWViODUxY2QwNjRjODYyMGI5NTk5ZmFkZWQ0NzllNjcyMWIx
|
10
|
+
NTg3NTY3YjA3MTFlOTFkODdhM2NjOWQwYmMxZGI4MzdkMDJlYjYzMmM2YjY5
|
11
|
+
MzY0MzZjODYwMDk0OTM2MzJjZTJhZTUxZGExMGRjMDIwYjU1ZTg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDc1ZjQxNzgxNmQwYjJlNjlhNDUxNzJhOGY1ZTkyOTdkYTQ5ZWM1YzExNGU0
|
14
|
+
NGUyNDBhZjBkNGY4OGU1OTgyZjlkMDdiMDg2NWM0MjUwMGU0NzQwZDYzM2U1
|
15
|
+
YjYxMjBkOGE3MzU2M2NiNGQ2ODNlZDMzZWM4OTdmOTM0MWIyNTA=
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module ActiveRecordHtmlStripper
|
2
2
|
module ActsAsHtmlStripper
|
3
3
|
|
4
|
-
def acts_as_html_stripper
|
4
|
+
def acts_as_html_stripper(opts = {})
|
5
5
|
before_validation do |record|
|
6
6
|
for column in record.class.content_columns
|
7
7
|
if column.type == :string || column.type == :text
|
8
8
|
if !record[column.name].nil?
|
9
|
-
record[column.name] = Sanitize.clean(record[column.name])
|
9
|
+
record[column.name] = Sanitize.clean(record[column.name],elements: opts[:allow])
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|