README.md in phony_rails-0.4.2 vs README.md in phony_rails-0.5.0
- old
+ new
@@ -98,10 +98,14 @@
To first normalize the String to a certain country use:
<%= "010-12341234".phony_formatted(:normalize => :NL, :format => :international, :spaces => '-') %>
+To return nil when a number is not valid:
+
+ "123".phony_formatted(:strict => true) # => nil
+
You can also use the bang method (phony_formatted!):
number = "010-12341234"
number.phony_formatted!(:normalize => :NL, :format => :international)
number # => "+31 10 12341234"
@@ -111,9 +115,12 @@
Say you want to find a record by a phone number. Best is to normalize user input and compare to an attribute stored in the db.
Home.find_by_normalized_phone_number(PhonyRails.normalize_number(params[:phone_number]))
## Changelog
+
+0.5.0
+* Added :strict option to String#phony_formatted.
0.4.2
* Added @fareastside validation for country_code.
0.4.0/0.4.1
\ No newline at end of file