summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-06-15 12:50:45 +0200
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-06-27 09:39:05 +0200
commite7d12a70d283b766cbcd4f417c293f34df10de3b (patch)
treea577fe25f2faee5486cdb86ad3878f618dc6b726 /app
parent6f5a68f528d6c11f3bfd013e30cc71845abe6ef8 (diff)
downloadgitlab-ce-e7d12a70d283b766cbcd4f417c293f34df10de3b.tar.gz
Add in_review_folder to usage pingzj-review-apps-usage-data
As its hard to reliably check how many review apps there are on the clients machine, we start by checking where the type is `review`. This means the folder is called that way. This will lead to a seq scan on the table. However, this is done once a week, so the benefit of adding an index seems not to apply here.
Diffstat (limited to 'app')
-rw-r--r--app/models/environment.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
index 6211a5c1e63..c56e4bdb989 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -45,6 +45,7 @@ class Environment < ActiveRecord::Base
to_sql
order(Gitlab::Database.nulls_first_order("(#{max_deployment_id_sql})", 'ASC'))
end
+ scope :in_review_folder, -> { where(environment_type: "review") }
state_machine :state, initial: :available do
event :start do