wkranec/finance — pull request #16 by thadd (2012-10-29 00:09:40+00:00)
Title: Fix for #9

I've dug into #9 a bit and it seems that the problem is that when you're in the Rails environment, Numeric.to_d that is overridden in the finance gem doesn't behave the same way.

In Rails console:

```ruby
ruby-1.9.3-p194 :001 > 1.2.class
=> Float
ruby-1.9.3-p194 :002 > 1.2.to_d.class
=> BigDecimal
```
In irb:

```ruby
ruby-1.9.3-p194 :001 > require 'finance'
=> true
ruby-1.9.3-p194 :002 > 1.2.class
=> Float
ruby-1.9.3-p194 :003 > 1.2.to_d.class
=> Flt::DecNum
```

I've tried even adding the Numeric.to_d in a Rails initializer, but that didn't work. I created [this commit](https://github.com/thadd/finance/commit/9b85aea321355ae8c30593840db0e2a5987b6a5c) that takes a brute force approach and explicitly initializes all of the places where Flt::DecNum is expected rather than relying on to_d. This has (so far) fixed the issue for me.