Thanks Fred,
I found what I was looking for. I found the code for the adapter and
these 2 lines are pretty revealing:
return :boolean if OracleAdapter.emulate_booleans &&
field_type == 'NUMBER(1)'
@@emulate_booleans = true
Thanks a lot for your help. :)
Pepe
On Sep 5, 9:42 am, Frederick Cheung <[EMAIL PROTECTED]>
wrote:
> On 5 Sep 2008, at 14:39, pepe wrote:
>
>
>
>
>
> > Hello.
>
> > This is a new post for a message I didn't get any answers to. I hope
> > this post catches somebody's eye and helps me with the issue. Sorry
> > for the duplication but this is driving me nuts.
>
> > The environment is:
> > - Ruby version is 1.8.6
> > - Rails version is 1.2.3.
> > -Databaseis Oracle (10g) in which I have a table with one defined
> > as:
> > MY_FIELD NUMBER(1,0)DEFAULT'2'
>
> > When a record is created in thedatabasethe value that invariable
> > gets posted to the table is 0 (zero) instead of 2. However, if I
> > change the field to:
> > MY_FIELD NUMBER(2,0)DEFAULT'2', thedefaultvalue of 2 is
> > correctly posted.
>
> > Is there a reason Rails would override the value for a NUMBER(1,0)
> > field? Is it believing that the field is a true/false container and
> > changes thedefaultto a 0 (zero) since it is not a 1 ('true')?
>
> > Any ideas why this is happening and/or how to solve it short of
> > modifying the column's length?
>
> Well the mysql adapter has a MysqlAdapter.emulate_booleans setting
> that does that with tinyint(1) columns.
>
> The oracle adapter could conceivably be doing the same thing - check
> the source!
>
> Fred
>
>
>
> > Thanks in advance.
>
> > Pepe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" 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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---