preformatter 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.0
1
+ 0.7.1
@@ -65,12 +65,12 @@ module Preformatter
65
65
  end
66
66
  end
67
67
 
68
- def remove_extra_white_spaces(*args)
68
+ def remove_extra_white_spaces(*args)
69
69
  args.each do |field|
70
- before_validation do |record|
70
+ before_save do |record|
71
71
  attribute = record.send("#{field.to_s}")
72
- attribute = attribute.strip.gsub(/[ ]+/, ' ') unless attribute.nil?
73
- attribute
72
+ attribute.strip! if !attribute.nil? and !attribute.strip!.nil?
73
+ attribute.gsub!(/[ ]+/, ' ') if !attribute.nil? and !attribute.gsub!(/[ ]+/, ' ').nil?
74
74
  end
75
75
  end
76
76
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{preformatter}
8
- s.version = "0.7.0"
8
+ s.version = "0.7.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Adrian Cuadros", "Eduardo Moreno", "Andres Paglayan"]
12
- s.date = %q{2010-07-07}
12
+ s.date = %q{2010-07-08}
13
13
  s.description = %q{The gem helps you by deleting spaces, special characters or replacing accents in the fields you need.}
14
14
  s.email = %q{adrian@innku.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 0
9
- version: 0.7.0
8
+ - 1
9
+ version: 0.7.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Adrian Cuadros
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-07-07 00:00:00 -05:00
19
+ date: 2010-07-08 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency