Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing callback action error #73

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JoshAntBrown
Copy link

@JoshAntBrown JoshAntBrown commented Feb 1, 2024

Using the library with Rails 7.1 currently results in this error:

The unlock action could not be found for the :check_for_lockup callback on SomeController, but it is listed in the controller's :except 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.

This is because the unlock action does not exist in my applications controllers, nor should I add the unlock action to those controllers.

The LockupController responsible for unlocking already has a skip_before_action/filter call and means the exception was unnecessary.

if self.respond_to?(:skip_before_action)
skip_before_action :check_for_lockup
else
skip_before_filter :check_for_lockup
end


I've solved this in my project by adding the following directly to my application controller:

  if respond_to?(:before_action)
    before_action :check_for_lockup
  else
    before_filter :check_for_lockup
  end

@nialbima
Copy link

nialbima commented Sep 6, 2024

@JoshAntBrown I'm seeing this issue with a current Rails upgrade. 6 months down the line, has this given you any trouble?

@JoshAntBrown
Copy link
Author

I've since removed this dependency from my project because I no longer require its functionality. No issues while I was using it though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants