Skip to content

Commit

Permalink
[BaseController::Logger] Use miq_user_role.name
Browse files Browse the repository at this point in the history
While `virtual_delegates` can be used to improve performance via a
single attribute in a query, we already bring back the `miq_user_role`
(via the lookup_scope), so it is better to just use that.

And currently virtual_delegates don't support already loaded
relationships.
  • Loading branch information
NickLaMuro committed Jan 29, 2021
1 parent d1c9e09 commit 4810302
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/api/base_controller/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def log_api_auth
group = User.current_user.current_group
log_request("Authorization", :user => User.current_user.userid,
:group => group.description,
:role => group.miq_user_role_name,
:role => group.miq_user_role.name,
:tenant => group.tenant.name)
end
end
Expand Down

0 comments on commit 4810302

Please sign in to comment.