railhead_sanitize 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- value = self[field] && self[field].strip
26
- if sanitize_options && sanitize_options[:except].include?(field)
27
- self[field] = value
28
- elsif sanitize_options && sanitize_options[:allow_tags].include?(field)
29
- self[field] = sanitize(value)
30
- else
31
- self[field] = strip_tags(value)
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
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "railhead_sanitize"
3
- s.version = "0.2.1"
4
- s.date = "2009-01-27"
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.1
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: 2009-01-27 00:00:00 +01:00
12
+ date: 2010-01-26 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15