langalex/couch_potato — pull request #87 by wrshawn (2014-01-24 00:20:04+00:00)
Title: makes cast_native cast floats with no leading digits.

This pull request makes the ```cast_native``` function properly cast floats with no leading digits, to make it more consistent with ruby's ```to_f``` method. In ruby, ```".333".to_f == 0.333``` but ```cast_native(".333", Float) === 333.0```

Here is an example script:

```ruby
require 'couch_potato'

CouchPotato::Config.database_name = 'mytestdb'

class Model
include CouchPotato::Persistence

property :number, type: Float
end

model = Model.new({"number" => "0.300"})
#model.number == 0.3

model2 = Model.new({"number" => ".300"})
#model2.number == 300.0 before the fix
#model2.number == 0.3 after the fix
```