Explain why we use select all for project_url_constrainer.rb

This commit is contained in:
Dmitriy Zaporozhets 2017-08-09 12:41:20 +00:00
parent 22c02bc22a
commit ec2d6b495b

View file

@ -6,6 +6,8 @@ class ProjectUrlConstrainer
return false unless DynamicPathValidator.valid_project_path?(full_path) return false unless DynamicPathValidator.valid_project_path?(full_path)
# We intentionally allow SELECT(*) here so result of this query can be used
# as cache for further Project.find_by_full_path calls within request
Project.find_by_full_path(full_path, follow_redirects: request.get?).present? Project.find_by_full_path(full_path, follow_redirects: request.get?).present?
end end
end end