@@ -27,11 +27,11 @@ In your model add:
27
27
28
28
class SomeModel < ActiveRecord::Base
29
29
30
- # Normalizes the attribute itself before validation
30
+ # Normalizes the attribute itself before validation
31
31
phony_normalize :phone_number, :default_country_code => 'US'
32
32
33
33
# Normalizes attribute before validation and saves into other attribute
34
- phony_normalize :phone_number, :as => :phone_number_normalized_version, :default_country_code => 'US'
34
+ phony_normalize :phone_number, :as => :phone_number_normalized_version, :default_country_code => 'US'
35
35
36
36
# Creates method normalized_fax_number that returns the normalized version of fax_number
37
37
phony_normalized_method :fax_number
@@ -78,11 +78,11 @@ In your views use:
78
78
79
79
<%= "311012341234".phony_formatted(:format => :international, :spaces => '-') %>
80
80
<%= "+31-10-12341234".phony_formatted(:format => :international, :spaces => '-') %>
81
- <%= "+31(0)1012341234".phony_formatted(:format => :international, :spaces => '-') %>
81
+ <%= "+31(0)1012341234".phony_formatted(:format => :international, :spaces => '-') %>
82
82
83
83
To first normalize the String to a certain country use:
84
84
85
- <%= "010-12341234".phony_formatted(normalize => :NL, :format => :international, :spaces => '-') %>
85
+ <%= "010-12341234".phony_formatted(normalize => :NL, :format => :international, :spaces => '-') %>
86
86
87
87
You can also use the bang method (phony_formatted!):
88
88
@@ -98,28 +98,31 @@ Say you want to find a record by a phone number. Best is to normalize user input
98
98
99
99
## Changelog
100
100
101
+ 0.2.1
102
+ * Better error handling by @k4nar
103
+
101
104
0.1.12
102
105
* Further loosened gemspec dependencies.
103
106
104
107
0.1.11
105
- * Better gemspec dependency versions by rjhaveri.
108
+ * Better gemspec dependency versions by @ rjhaveri .
106
109
107
110
0.1.10
108
111
* Changes from henning-koch.
109
112
* Some pending fixes.
110
113
111
114
0.1.8
112
- * Improved validation methods by ddidier.
115
+ * Improved validation methods by @ ddidier .
113
116
114
117
0.1.6
115
118
* Added : as option to phony_normalize.
116
119
117
120
0.1.5
118
- * some tests and a helper method by ddidier.
121
+ * some tests and a helper method by @ ddidier .
119
122
120
123
0.1.2
121
- * Using countries gem as suggested by brutuscat.
122
- * Fixes bugs mentioned by ddidier.
124
+ * Using countries gem as suggested by @ brutuscat .
125
+ * Fixes bugs mentioned by @ ddidier .
123
126
124
127
0.1.0
125
128
* Added specs.
0 commit comments