This project is archived and is in readonly mode.
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
-
Jeremy Kemper August 26th, 2009 @ 10:50 PM
- State changed from new to open
- Milestone set to 2.3.4
The existing tests are enough. Putting the connection arg at the end though to avoid breaking folks using this API.
-
Repository August 26th, 2009 @ 10:55 PM
- State changed from open to committed
(from [8c05ca96f846fd37f99c3986bba5cadb4d7de040]) Don't use AR::Base.connection for fixture column quoting. Use the connection given to Fixtures.new
[#3104 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/8c05ca96f846fd37f99c3986bba5ca... -
Repository August 26th, 2009 @ 10:55 PM
(from [8a49183563d3f80ecd4024977429b62f671f9f7c]) Don't use AR::Base.connection for fixture column quoting. Use the connection given to Fixtures.new
[#3104 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/8a49183563d3f80ecd4024977429b6...
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
Tags
Referenced by
- 3104 Fixture columns should be quoted by the appropriate connection [#3104 state:committed]
- 3104 Fixture columns should be quoted by the appropriate connection [#3104 state:committed]