Files
openfoodnetwork/lib/spree/authentication_helpers.rb
Maikel Linke d9f013abbc Style/SendWithLiteralMethodName
Use method call directly instead of `public_send` with fixed argument.

The cop is declared unsafe. I think that is because it can also replace
`send` but we replace only `public_send` here.
2024-06-05 09:38:21 +10:00

22 lines
443 B
Ruby

# frozen_string_literal: true
module Spree
module AuthenticationHelpers
def self.included(receiver)
receiver.helper_method :spree_current_user
receiver.helper_method :spree_login_path
receiver.helper_method :spree_logout_path
end
def spree_current_user
current_spree_user
end
def spree_login_path
main_app.login_path
end
delegate :logout_path, to: :spree, prefix: true
end
end