diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-04-12 15:07:44 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-04-16 15:05:35 +0300 |
commit | 392c411bdc16386ef42c86afaf8c4d8e4cddb955 (patch) | |
tree | 4dc69bd81002c4c68885442a201fd17328b40813 /app/models/project_ci_cd_setting.rb | |
parent | 4fcee58636259e523a0e1b85e2090160a3938496 (diff) |
Introduce new ProjectCiCdSetting
This model and the corresponding table will be used for storing settings
specific to CI/CD, starting with the "group_runners_enabled" boolean.
The model is called ProjectCiCdSetting and not ProjectCiCdSettings. The
project exporter doesn't like plural model names as it uses "classify"
which turns those into singular (so "ProjectCiCdSettings" becomes
"ProjectCiCdSetting", producing an error if said class is undefined).
The initial work in this commit was done by Dylan Griffith, with most of
the migration work being done by Yorick Peterse.
Diffstat (limited to 'app/models/project_ci_cd_setting.rb')
-rw-r--r-- | app/models/project_ci_cd_setting.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/models/project_ci_cd_setting.rb b/app/models/project_ci_cd_setting.rb new file mode 100644 index 00000000000..9f10a93148c --- /dev/null +++ b/app/models/project_ci_cd_setting.rb @@ -0,0 +1,16 @@ +class ProjectCiCdSetting < ActiveRecord::Base + belongs_to :project + + # The version of the schema that first introduced this model/table. + MINIMUM_SCHEMA_VERSION = 20180403035759 + + def self.available? + @available ||= + ActiveRecord::Migrator.current_version >= MINIMUM_SCHEMA_VERSION + end + + def self.reset_column_information + @available = nil + super + end +end |