Hey, I have connected to the oracle db using ActiveRecord and am trying to retrieve tuples. I have one attribute that has datatype ''number(1)''. I found that ActiveRecord maps this attribute to boolean. So it gets a class of either FalseClass or TrueClass. I tried to find the source of the problem and I found oracle_adapter.rb (http:// www.koders.com/ruby/fidAF6400E299159A198A4064173CF305C895FCA945.aspx?s=%22Michael+Schoen%22#L5) has a method ''simplified_field'' that has a line "return :boolean if OracleAdapter.emulate_booleans && field_type =''NUMBER(1)''". I tried overriding this method on my environment.rb and commented out this line. This problem is solved but I have another field of type ''Interval'' which has to get mapped to String, but instead gets mapped to Fixnum when i do this override. Anyone got a clue what''s happening. Please help. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Niranjan Jayakar
2008-Jul-04 13:23 UTC
Re: datatype problem when using ActiveRecord with Oracle
It would even be useful if anyone told me how to update the database without using ActiveRecord::update() and just by pure sql command. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---