I am new to active record so apologies for the newbie question, but I am
trying to set it up to access an Oracle database. Please note, this not
a rails app and never will be. I want to use JRuby to write dashboard
scripts for monitoring an number of back-end ETL data interfaces for
which I am primarily responsible.
My config is as follows:
Client PC running Windows
Oracle driver - ojdbc14.jar
Remote database hosted on Solaris
My problem is that active record is failing to typecast date and time
fields at all.
For example, the following cutdown example attempts to access ‘RUN_DT’
which is defined in the database as a DATE (I am seeing the same issue
on TIMESTAMP fields too)…
puts “Starting active record”
puts “Connecting to MXGN”
:adapter => ‘jdbc’,
:driver => ‘oracle.jdbc.OracleDriver’,
:url => ‘jdbc:oracle:thin:@MYHOST:1550:THEDB’,
:username => ‘FOO’,
:password => ‘bar’
puts “Running a query”
class TblMigrationWork < ActiveRecord::Base
result = TblMigrationWork.find(:first, :conditions => ‘run_id = 1’)
Starting active record
Connecting to MXGN
Running a query
method_missing': undefined methodstring_to_time’ for
string_to_time' from C:/gems/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:211:inrun_dt’
I can query VARCHAR and NUMERIC fields with no problems.
I have had a good look round the forums but I cannot find any reference
to this kind of problem. Can you please suggest a solution or where the
problem may be ocurring?