Edge Rails Bites Back
So in my last post I bragged of my disregard for David’s railsconf keynote recommendation to stay a bit back from edge rails. This post, instead, I humbly have fallen at the mercy of a meager changeset. In changeset 6922, Jeremy Kemper updated singleton resources to now point to plural controllers rather than singular.
What used to be…
map.resource :logo # => points to LogoController
map.resource :logo # => points to LogosController
Notice that it points to the plural controller. The change was “so the controller may be reused for multiple nestings or namespaces.” Tonight, I updated my rails trunk and suddenly I could no longer log into an app that I am working on. I’m using a singleton resource for my session controller and each time I tried to login, I would get the following error:
uninitialized constant SessionsController
Cockily, I dove into the routes, thinking that perhaps I could find the newly introduced “bug.” 45 minutes later (routing is CRAZY in rails), I did a simple search on google and found this tumble informing me of the change (who says tumblelogs aren’t important). I’m subscribed to the changesets but somehow 6922 slipped through. Here’s hoping it doesn’t bite you as well.