Module: BeetleReporter::ApplicationHelper

Includes:
Pagy::Frontend
Defined in:
app/helpers/beetle_reporter/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#avatar(user) ⇒ Object



9
10
11
12
# File 'app/helpers/beetle_reporter/application_helper.rb', line 9

def avatar(user)
  return user.avatar unless user.avatar.blank?
  Avatarro.image(user.nickname.first) if user.respond_to?(:nickname)
end

#current_userObject



5
6
7
# File 'app/helpers/beetle_reporter/application_helper.rb', line 5

def current_user
  main_app.scope.request.env['warden']&.user
end