igorkasyanchuk / rails_db

Rails Database Viewer and SQL Query Runner
https://www.railsjazz.com/
MIT License
1.46k stars 111 forks source link

Fix for Rails 7.1 missing callback action #139

Closed bpurinton closed 4 weeks ago

bpurinton commented 4 weeks ago

Resolves https://github.com/igorkasyanchuk/rails_db/issues/134

Problem

In Rails 7.1, the new default behavior for missing callbacks is:

AbstractController::ActionNotFound - The search action could not be found for the :find_table
callback on RailsDb::TablesController, but it is listed in the controller's
:only option.
Raising for missing callback actions is a new default in Rails 7.1, if you'd
like to turn this off you can delete the option from the environment configurations
or set `config.action_controller.raise_on_missing_callback_actions` to `false`.:

Solution

It turns out that the :search method was not defined anywhere, and thus was a missing from the LOAD_TABLE_ACTIONS list for the find_table callback. Simply removing this fixed the problem.

igorkasyanchuk commented 4 weeks ago

thanks! will release a new version right now