railhead_sanitize 0.2.1 → 0.2.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.
- data/lib/railhead_sanitize.rb +8 -7
- data/railhead_sanitize.gemspec +2 -2
- metadata +2 -2
data/lib/railhead_sanitize.rb
CHANGED
@@ -22,13 +22,14 @@ module RailheadSanitize
|
|
22
22
|
self.class.columns.each do |column|
|
23
23
|
next unless column.type == :string or column.type == :text
|
24
24
|
field = column.name.to_sym
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
if self[field].is_a?(String)
|
26
|
+
self[field] = if sanitize_options && sanitize_options[:except].include?(field)
|
27
|
+
self[field].strip
|
28
|
+
elsif sanitize_options && sanitize_options[:allow_tags].include?(field)
|
29
|
+
sanitize(self[field]).strip
|
30
|
+
else
|
31
|
+
strip_tags(self[field]).strip
|
32
|
+
end
|
32
33
|
end
|
33
34
|
end
|
34
35
|
end
|
data/railhead_sanitize.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "railhead_sanitize"
|
3
|
-
s.version = "0.2.
|
4
|
-
s.date = "
|
3
|
+
s.version = "0.2.2"
|
4
|
+
s.date = "2010-01-26"
|
5
5
|
s.summary = "RailheadSanitize is a Ruby on Rails plugin that automatically strips tags from input fields."
|
6
6
|
s.email = "nagybence@tipogral.hu"
|
7
7
|
s.homepage = "http://github.com/nagybence/railhead_sanitize"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: railhead_sanitize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bence Nagy
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-26 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|