diff options
author | Mathieu Parent <math.parent@gmail.com> | 2019-05-15 16:27:54 +0200 |
---|---|---|
committer | Mathieu Parent <math.parent@gmail.com> | 2019-07-03 16:18:05 +0200 |
commit | e44167004dd44cf727829d0fc9df59fe3404bb49 (patch) | |
tree | cdc94639756dc8cfbb996bd84c26540205a75ae9 /lib/api/entities.rb | |
parent | 5028f5d73d8fa69f72ac8d2b1cc493d82cf6f3e4 (diff) | |
download | gitlab-ce-e44167004dd44cf727829d0fc9df59fe3404bb49.tar.gz |
Add auto_devops_* to project API
The auto_devops object sometimes doesn't exists. We may need to create
it.
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index c6c7023042f..7bf66589616 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -294,6 +294,10 @@ module API options[:statistics] && Ability.allowed?(options[:current_user], :read_statistics, project) } expose :external_authorization_classification_label + expose :auto_devops_enabled?, as: :auto_devops_enabled + expose :auto_devops_deploy_strategy do |project, options| + project.auto_devops.nil? ? 'continuous' : project.auto_devops.deploy_strategy + end # rubocop: disable CodeReuse/ActiveRecord def self.preload_relation(projects_relation, options = {}) |