mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-24 05:38:52 +00:00
Replace duplicate method with module inclusion
No reason to risk diverging their implementations. They are exact copies. Likewise, there's no need to have to I18n keys with almost the same content.
This commit is contained in:
@@ -21,18 +21,6 @@ module Spree
|
||||
flash[:notice] = warning if warning.present?
|
||||
end
|
||||
|
||||
# This is in Spree::Core::ControllerHelpers::Auth
|
||||
# But you can't easily reopen modules in Ruby
|
||||
def unauthorized
|
||||
if spree_current_user
|
||||
flash[:error] = t(:authorization_failure)
|
||||
redirect_to '/unauthorized'
|
||||
else
|
||||
store_location
|
||||
redirect_to main_app.root_path(anchor: "login?after_login=#{request.env['PATH_INFO']}")
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def model_class
|
||||
|
||||
Reference in New Issue
Block a user