This project is archived and is in readonly mode.

#3104 ✓committed
Jeffrey Hardy

Fixture columns should be quoted by the appropriate connection

Reported by Jeffrey Hardy | August 26th, 2009 @ 08:11 PM | in 2.3.4

AR::Fixtures.create_fixtures(...) { Custom.connection } will quote columns using AR::Base.connection rather than the custom connection. This is a problem when AR::Base.connection and Custom.connection use different adapters that perform quoting differently, as is the case with mysql and sqlite3.

This patch changes Fixture.new to take the connection object from Fixtures and use it for column quoting. If no connection is provided by the block, the default is AR::Base.connection.

I wasn't sure how to test this particular case. The AR tests are made to be run with different adapters, but I couldn't find examples where a case is using two different ones. Since this change is exercised by existing fixture tests, I left it. Suggestions?

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments