rsim/oracle-enhanced — pull request #258 by substars (2012-11-29 06:42:32+00:00)
Title: NUMBER columns should be of type :float, not :decimal

I looked into #256 a bit more and realized it's not just a problem with virtual columns:

```
t.float :floatnum # => NUMBER

# loaded and dumped, yields

t.decimal "floatnum" # => NUMBER(38,0)
```

LIke in #256, the schema dump isn't what the migration originally created. I don't see how :decimal types could ever work for this purpose since there's no way to know the correct scale/precision values.

So, I fixed OracleEnhancedColumn to return a :float type for NUMBER columns rather than :decimal. This fixes schema dumping, but there's a catch: all the ActiveRecord versions I've tried are casting column values to Float now instead of BigDecimal.

I'm not sure what to do about this. On one hand, @rsim wrote tests to explicitly ensure that NUMBER columns returned BigDecimal values, so this change could break things for people.

But on the other hand, returning Floats make the adapter consistent with how other database adapters work (MySQL also apparently gives :decimal values a default scale of zero, and the AR adapter returns float columns as Floats).

Using BigDecimals for everything would involve overriding AR behavior, so I thought I'd ask for opinions first. It could also be made configurable (and maybe default to BigDecimal since that's what the adapter currently does).

Thoughts? At a minimum, this is probably a better fix for #256 since the dumper can actually determine the proper type for any precision/scale values, and for non-virtual columns.