I was wondering what the best way to add extra functionality to Devise’s session#destroy action would be.
To give some context, I’m making a website where Users have Carts, and when the user’s session either times out or he logs out, I want his Cart to be labeled as inactive.
I found this but I’m a bit hesitant to override the Devise controller, as it seems a bit messy…
Are there any other ways to set this Cart to inactive when a user’s session is destroyed?
I do suggest you derive your controller from devise and hook onto the action, so you can safely keep away from devise’s internals.