Wednesday, August 05, 2009

Differences JRuby JDBC-Adapter for mysql and Ruby MysqlAdapter in method: pk_and_sequence_for


This will result in a bad schema.rb when using non default primary-keys and thus test databases are not created correct.

JRuby

>> connection = ActiveRecord::Base.connection
=> #<ActiveRecord::ConnectionAdapters::JdbcAdapter:0x321bc965>
>> connection.respond_to?(:pk_and_sequence_for)
=> false
>> connection.respond_to?(:primary_key)
=> false


Ruby

>> connection = ActiveRecord::Base.connection
=> #<ActiveRecord::ConnectionAdapters::MysqlAdapter:0x19ad73c @co...
>> connection.respond_to?(:pk_and_sequence_for)
=> true
>> connection.respond_to?(:primary_key)
=> false