On 11/13/07, knightsc <[EMAIL PROTECTED]> wrote:
> On Nov 13, 1:35 pm, "Jeremy Kemper" <[EMAIL PROTECTED]> wrote:
> > numeric with no decimal digits are typically used for big integers, so
> > mapping them to Ruby big integers is natural and expected. I think
> > it's a good convention.
>
> So should the Fireruby driver be modified to return the base type that
> the database is actually using to store a field? This isn't always
> going to be the same for every database for instance a decimal(2)
> might be stored as something small in mysql and in turn a test is
> expecting a FixNum but in Firebird this field is really stored as an
> integer so even If I returned the base type it still might not match
> what the test is expecting. Do you see what I mean? I think you're not
> really suppose to be seeing the underlying types from a database if a
> field is declared as NUMERIC or DECIMAL then the result should be a
> BigDecimal it just so happens that maybe that BigDecimal has precision
> and maybe not.

I'm not sure I'm parsing you correctly, but I think you're saying that
since you declared numeric type, you always want the Ruby type
representing it to have decimal points even if the numeric has no
decimal points and is not intended to be input, displayed, or
manipulated as a number with decimal points.

Why would you ever want that? It's creating a ton of extra work with
no real benefit other than appearing definitionally consistent.
Numeric columns with no decimal points are used to represent integers,
so we use integers in Ruby; I'm surprised that this is surprising.

jeremy

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to