Project

General

Profile

« Previous | Next » 

Revision 92d40b23

Added by Tomer Brisker over 2 years ago

Refs #34093 - Minor authorizer clean ups

- Use `.exists?` instead of `.where.any?` and `.where.present?`.
`.any?` avoids triggering another sql query for loaded relations, but in
this specific case the relation won't be loaded. `.present?` loads the
relation to an array and checks if it is empty, which is obviously worse
then checking in sql.
- Use regular `Hash` instead of `HashWithIndefferentAccess`
HWIA comes with a performance overhead since it needs to handle both
string and symbol keys. Since the `@cache` is only used in one place, we
can control the keys and use a regular Hash instead.

  • added
  • modified
  • copied
  • renamed
  • deleted