metamaps--metamaps/app/helpers/application_helper.rb
2018-03-08 09:47:15 -05:00

14 lines
386 B
Ruby

# frozen_string_literal: true
module ApplicationHelper
def invite_link
"#{request.base_url}/join" + (current_user ? "?code=#{current_user.code}" : '')
end
def user_unread_notifications_count
return 0 if current_user.nil?
@uunc ||= current_user.mailboxer_notification_receipts.reduce(0) do |total, receipt|
receipt.is_read ? total : total + 1
end
end
end