This project is archived and is in readonly mode.
ActiveRecord middleware should be inserted before ActionDispatch::Cascade ?
Reported by Lawrence Pit | April 28th, 2010 @ 01:41 AM | in 3.0.2
Using rails 3 beta 3. I have a piece of metal code, and I think it's fair to assume that most users will use some ActiveRecord code in there to retrieve some data.
However, the metal code is run before the middleware ActiveRecord::ConnectionAdapters::ConnectionManagement. I.e., when something fails in the metal code, then the AR connection manager will not get the chance to do: ActiveRecord::Base.clear_active_connections!
I have a few other use cases where I find it would be more useful if middleware ActionDispatch::Cascade was sitting just before MyApp::Application.routes and after ActiveRecord::QueryCache and any other user defined middlewares.
Comments and changes to this ticket
-
Lawrence Pit April 28th, 2010 @ 08:11 AM
Actually, just found out that all my middlewares are sitting before ActiveRecord::ConnectionAdapters::ConnectionManagement. Perhaps the position of ActionDispatch::Cascade should be unchanged, and instead ActiveRecord::ConnectionAdapters::ConnectionManagement (and ActiveRecord::QueryCache ?) should go in front of ActionDispatch::Cascade ?
-
Jeremy Kemper April 28th, 2010 @ 04:57 PM
- Milestone cleared.
- State changed from new to open
- Assigned user set to José Valim
-
José Valim April 28th, 2010 @ 05:34 PM
Hey Lawrence, let's fix it but we need a test case first.
What happens if clear_active_connections! is not called? What failure do you get? -
Repository April 29th, 2010 @ 12:44 PM
- State changed from open to resolved
(from [3dfcb56e4585c8530be6dcc5129ae0c4d16c0dea]) ActiveRecord middlewares should be inserted before AD::Cascade [#4493 state:resolved]. http://github.com/rails/rails/commit/3dfcb56e4585c8530be6dcc5129ae0...
-
csnk May 18th, 2011 @ 08:25 AM
We are the professional scarfs manufacturer, scarfs supplier, scarfs factory, custom scarfs.
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
Tags
Referenced by
- 4493 ActiveRecord middleware should be inserted before ActionDispatch::Cascade ? (from [3dfcb56e4585c8530be6dcc5129ae0c4d16c0dea]) ActiveR...