jruby / activerecord-jdbc-adapter

JRuby's ActiveRecord adapter using JDBC.
BSD 2-Clause "Simplified" License
462 stars 386 forks source link

CPK, Oracle & activerecord-jdbc-adapter problem with arel_attributes_values #46

Open consu opened 13 years ago

consu commented 13 years ago

Hello,

I'm using Composite Primary Keys with Rails 3, Oracle and jruby / activerecord-jdbc-adapter. ActiveRecord-JDBC-Adapter overrides arel_attributes_values (quoted_primary_key.rb), but this change isn't working with cpk.

Is this a cpk or activerecord-jdbc-adapter issue?

I have commented out all changes in quoted_primary_key.rb and now my code seams t o work. Is this special handling for Oracle + Rails 3 still necessary?

Regards Dieter

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

nicksieger commented 13 years ago

Thanks for submitting. Which version of Rails are you using? It's possible that Arel has changed enough since the most recent release that this isn't necessary, or there could be some other edge case that you're not hitting.

If you want to disable QuotedPrimaryKeyExtension in your project, you might consider doing something like:

require 'arjdbc/jdbc/quoted_primary_key'
module ArJdbc::QuotedPrimaryKeyExtension; def self.extended(*); end; end

in a Rails initializer and see if that monkey-patches it off.

consu commented 13 years ago

I'm using Rails 3.0.7. I did create a custom monkey-patch with a loop around every primary key column, like you did it for a single primary key.