Merge branch 'master' of github.com:couchrest/couchrest_model
Conflicts: history.txt
This commit is contained in:
commit
0e51dcfb9a
4 changed files with 18 additions and 2 deletions
|
@ -79,7 +79,7 @@ module CouchRest
|
|||
# Match numeric string
|
||||
def typecast_to_numeric(value, method)
|
||||
if value.respond_to?(:to_str)
|
||||
if value.gsub(/,/, '.').gsub(/\.(?!\d*\Z)/, '').to_str =~ /\A(-?(?:0|[1-9]\d*)(?:\.\d+)?|(?:\.\d+))\z/
|
||||
if value.strip.gsub(/,/, '.').gsub(/\.(?!\d*\Z)/, '').to_str =~ /\A(-?(?:0|[1-9]\d*)(?:\.\d+)?|(?:\.\d+))\z/
|
||||
$1.send(method)
|
||||
else
|
||||
value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue