sanitize-rails 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/sanitize/rails.rb +5 -4
  2. metadata +2 -2
@@ -4,7 +4,7 @@ require 'sanitize'
4
4
  require 'sanitize/railtie' if defined? Rails
5
5
 
6
6
  module Sanitize::Rails
7
- Version = '0.6.0'
7
+ Version = '0.6.1'
8
8
 
9
9
  # Configures the sanitizer with the given `config` hash.
10
10
  #
@@ -38,7 +38,7 @@ module Sanitize::Rails
38
38
  # Returns a copy of the given `string` after sanitizing it
39
39
  #
40
40
  def clean(string)
41
- clean!(string.dup)
41
+ string.dup.tap {|s| clean!(s)}
42
42
  end
43
43
 
44
44
  # Sanitizes the given `string` in place
@@ -99,8 +99,9 @@ module Sanitize::Rails
99
99
 
100
100
  define_method(sanitizer) do # # Unrolled version
101
101
  fields.each do |field| #
102
- unless field.blank? # def sanitize_fieldA_fieldB
103
- sanitized = Engine.clean(send(field)) # self.fieldA = Engine.clean(self.fieldA) unless fieldA.blank?
102
+ value = send(field)
103
+ unless value.blank? # def sanitize_fieldA_fieldB
104
+ sanitized = Engine.clean(value) # self.fieldA = Engine.clean(self.fieldA) unless fieldA.blank?
104
105
  send("#{field}=", sanitized) # self.fieldB = Engine.clean(self.fieldB) unless fieldB.blank?
105
106
  end # end
106
107
  end #
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 0
9
- version: 0.6.0
8
+ - 1
9
+ version: 0.6.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Marcello Barnaba