Skip to content

Commit

Permalink
Merge pull request ManageIQ#17198 from NickLaMuro/memoize-miq-user-ro…
Browse files Browse the repository at this point in the history
…le-feature-identifier-cache

Fix 200+ SQL CACHE statements when hitting /api in logs
  • Loading branch information
bdunne authored Mar 26, 2018
2 parents f2f55f6 + 3648be4 commit ae25cf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/miq_user_role.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class MiqUserRole < ApplicationRecord
}

def feature_identifiers
miq_product_features.pluck(:identifier)
@feature_identifiers ||= miq_product_features.pluck(:identifier)
end

# @param identifier [String] Product feature identifier to check if this role allows access to it
Expand Down

0 comments on commit ae25cf0

Please sign in to comment.