我有一个redmine插件,redmine_omniauth_google的麻烦。当在新的redmine 4.1.1中作为唯一的插件安装时,日志显示以下错误:
FATAL -- : ArgumentError (Before process_action callback :check_if_login_required has not been defined):
类的层次结构是:
ApplicationController (plugins/redmine_omniauth_google/app/controllers/application_controller.rb)
AccountController (app/controllers/account_controller.rb)
RedmineOAuthController (app/controllers/redmine_oauth_controller.rb)
check_if_login_required在application_controller.rb
在account_controller。rb我明白了:
class AccountController < ApplicationController
...
# prevents login action to be filtered by check_if_login_required application scope filter
skip_before_action :check_if_login_required, :check_password_change
RedmineOAuthController中没有check_if_login_required的引用
谁能帮助我了解这个子类是如何隐藏在父类中定义的方法?使用rails运行5.2.4.2
我(不知何故)把它安装在一个生产系统中,它似乎是工作的。我已经区分了插件中的所有文件,它们是相同的。我试过复制Gemfile。也可以锁定,但是问题仍然存在。
我发现了这篇文章
表示添加raise:false
我不知道这是否是最好的方法,但改变以下行在account_controller文件修复错误:
skip_before_action :check_if_login_required, :check_password_change, raise: false
如果有人有更好的方法,我很感兴趣