module PerUserStatus::Patches::UserPatch
Patches
the User#name method to allow injecting the current user status
Public Instance Methods
name_with_custom_status(formatter = nil)
click to toggle source
Appends the custom user status to the base user name @param formatter The formatter to use for the name @see User#name
# File lib/per_user_status/patches/user_patch.rb, line 16 def name_with_custom_status(formatter = nil) default = name_without_custom_status(formatter) if custom_status.present? "#{default} (#{custom_status})" else default end end