activerecord_html_stripper 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGRhYmQ4MGJhMWNiZmZjZGRkNDVlNTQ1MDMzNDZiMWI4OTMxMzgzOQ==
4
+ MDU1MjdkYTJlYmMwMzA1ZGNmNzAwNTE4MGYwNzQ3OTZkM2VlNjc4OQ==
5
5
  data.tar.gz: !binary |-
6
- NTQ1MjRiM2JlZWE5MmY1MzNhZmJjMTUwNTNhMzBlYmZkNWNiNTg0YQ==
6
+ NjUyNGExOGE4MzE4YjQ4ZTA2YWM3NDMxZGFiMmVkMWRkYjNjNWQ1OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzkxODZmNzU1NGI1NGYyZWNjYzdiYmMwMmE2Y2QyZTMwYmIzYTVmNjc3MDAx
10
- OThjNjYzOWRlYzNhYzk1ZmM3MWE4ZmI3NGY1ZWNiYzZhOTI3OWY2ZDlkMzVi
11
- ZDgwNjcyNTc3OWU2Y2FiZGJlYmQxMTQ3NjEyM2QwNzk0YTdiZjk=
9
+ ZTllODFmNzUwYWViODUxY2QwNjRjODYyMGI5NTk5ZmFkZWQ0NzllNjcyMWIx
10
+ NTg3NTY3YjA3MTFlOTFkODdhM2NjOWQwYmMxZGI4MzdkMDJlYjYzMmM2YjY5
11
+ MzY0MzZjODYwMDk0OTM2MzJjZTJhZTUxZGExMGRjMDIwYjU1ZTg=
12
12
  data.tar.gz: !binary |-
13
- MWRhNTkyMjJkNzg1M2JkODYxMDUxOTY2OTZjNTNhYjc2NWZkODk1NmM1MTY5
14
- YjExZGM0MTc0Njg4YmViOWQ5MGI1N2Y5MzRkZmYzY2E1YWNiZjU2NDE1Y2Rm
15
- OGNjMDZiN2FlYTFhMjk1ZjVlN2Q3MTVlODAwOGUzYmU0ZjFjM2Q=
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
@@ -1,3 +1,3 @@
1
1
  module ActiverecordHtmlStripper
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord_html_stripper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ankit Gupta