Project

General

Profile

Actions

Refactor #29710

closed

Change false where conditions to `none`

Added by Tomer Brisker almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Database
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

There are multiple places where we use conditions like "where(1=0)" or "where(id<0)" etc. because we want to preserve the active relation object. Since Rails 4 there is `none` method that achieves the same goal with null object pattern, so the eventual query won't even be sent to the DB - https://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-none


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #31538: Each smart class parameter appears twice, when having two environmentsClosedTomer BriskerActions
Actions

Also available in: Atom PDF