diff options
author | Mathieu Parent <math.parent@gmail.com> | 2019-05-15 14:35:55 +0200 |
---|---|---|
committer | Mathieu Parent <math.parent@gmail.com> | 2019-07-03 16:18:05 +0200 |
commit | 353e68772c8b57ef4a98be094f2674d28a2dedcd (patch) | |
tree | 2bccce84d64aeae32415e7b4231178779825a072 /app | |
parent | 26b7b475586b67c9e9aee7ec7311cca712901dbc (diff) | |
download | gitlab-ce-353e68772c8b57ef4a98be094f2674d28a2dedcd.tar.gz |
Add build_git_strategy attribute to project API
We map the boolean to the string 'fetch' or 'clone', to be more
explicit.
Diffstat (limited to 'app')
-rw-r--r-- | app/models/concerns/project_api_compatibility.rb | 10 | ||||
-rw-r--r-- | app/models/project.rb | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/app/models/concerns/project_api_compatibility.rb b/app/models/concerns/project_api_compatibility.rb new file mode 100644 index 00000000000..9a0202c211c --- /dev/null +++ b/app/models/concerns/project_api_compatibility.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +# Add methods used by the projects API +module ProjectAPICompatibility + extend ActiveSupport::Concern + + def build_git_strategy=(value) + write_attribute(:build_allow_git_fetch, value == 'fetch') + end +end diff --git a/app/models/project.rb b/app/models/project.rb index 0f4fba5d0b6..822def0f936 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -15,6 +15,7 @@ class Project < ApplicationRecord include CaseSensitivity include TokenAuthenticatable include ValidAttribute + include ProjectAPICompatibility include ProjectFeaturesCompatibility include SelectForProjectAuthorization include Presentable |