JRuby 1.5.2 Rails 3.0 activerecord-jdbc-adapter 0.9.7 This issue arises when setting table name with a schema name prefix. For those in the know – this is a must-have if you’re connecting to oracle using a non-owner username (activerecord-jdbc-adapter).
@@tables include table names as read from the connection (sans schema name). The comparison with the
name always yields false resulting in an instantiation of an empty Header (with no attributes). Hence –
alias_table[<attr>] always returned nil and nil.eq is undefined. Anyways – as a work around (sorry: non tested monkey patch): in your apps lib folder (provided that it’s auto-loaded) – create the arel_ext.rb
Reported on activerecord-jdbc-adapter list: http://kenai.com/jira/browse/ACTIVERECORD_JDBC-132
Hey thanks for this, just a heads-up that @@tables no longer works, have to just use tables
I think this might be related to my problem.
Using Rails 3 with MS Sql Server 05.
Legacy tables -> with different names, non auto-incrementing primary key.
class Station < ActiveRecord::Base
self.table_name = “ZDS_SA_STATION”
self.primary_key = “ID_Station”
And I’m getting the error. I do hope this gets resolved ASAP!
@Omaer – have you tried using set_table_name and set_primary_key instead? Not sure if that would change anything but give it a try.
The issue corresponds to the activerecord-jdbc-adapter which I think is not the same as the adapter you are using. However, that “No Method Error” could be due to a lot of things. Try following your stack trace and see where the source of the issue is.
@david – thanks for the heads-up