Files
openfoodnetwork/lib/spree/authentication_helpers.rb
Maikel Linke 5925b023b3 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-17 14:56:23 +02: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