Sha256: 37dd50fd53a28936a5ce243c7e1306596b82a8e3713c31aebe822389647a6c03

Contents?: true

Size: 319 Bytes

Versions: 4

Compression:

Stored size: 319 Bytes

Contents

module BeetleReporter
  module ApplicationHelper
    include Pagy::Frontend

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
beetle_reporter-0.1.10 app/helpers/beetle_reporter/application_helper.rb
beetle_reporter-0.1.9 app/helpers/beetle_reporter/application_helper.rb
beetle_reporter-0.1.8 app/helpers/beetle_reporter/application_helper.rb
beetle_reporter-0.1.7 app/helpers/beetle_reporter/application_helper.rb