-
-
Save rromanchuk/486f6fbd4fec28c8fa69d36220795343 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if Rails.application.config.action_mailer.show_previews | |
Rails::MailersController.class_eval do | |
include AdminWebAuthenticatable | |
end | |
end | |
module AdminWebAuthenticatable | |
extend ActiveSupport::Concern | |
included do | |
before_action :require_user! | |
helper_method :current_user | |
helper_method :current_admin | |
rescue_from NotAuthorizedException, with: -> { redirect_to root_path } | |
end | |
# Truncated | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment