optimization: prefer relation.none over relation.where("false")
Using `relation.none` instead of `relation.where("false")` avoids an sql query.
This commit is contained in:
@@ -22,7 +22,7 @@ class PostArchive < ApplicationRecord
|
||||
if user_id
|
||||
where("updater_id = ?", user_id)
|
||||
else
|
||||
where("false")
|
||||
none
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user