summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/build.rb2
-rw-r--r--app/models/ci/runner.rb2
-rw-r--r--app/models/project.rb16
-rw-r--r--app/models/user.rb2
4 files changed, 11 insertions, 11 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index fac1d1c4c2c..401e08115dc 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -287,7 +287,7 @@ module Ci
end
def project_variables
- project.ci_variables.map do |variable|
+ project.variables.map do |variable|
{ key: variable.key, value: variable.value, public: false }
end
end
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb
index aa445db7ebf..38b20cd7faa 100644
--- a/app/models/ci/runner.rb
+++ b/app/models/ci/runner.rb
@@ -52,7 +52,7 @@ module Ci
def assign_to(project, current_user = nil)
self.is_shared = false if shared?
self.save
- project.ci_runner_projects.create!(runner_id: self.id)
+ project.runner_projects.create!(runner_id: self.id)
end
def display_name
diff --git a/app/models/project.rb b/app/models/project.rb
index a11bc9c4bd5..ba04470c64e 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -128,15 +128,15 @@ class Project < ActiveRecord::Base
has_one :import_data, dependent: :destroy, class_name: "ProjectImportData"
+ has_many :commit_statuses, dependent: :destroy, class_name: 'CommitStatus', foreign_key: :gl_project_id
has_many :ci_commits, dependent: :destroy, class_name: 'Ci::Commit', foreign_key: :gl_project_id
- has_many :ci_statuses, dependent: :destroy, class_name: 'CommitStatus', foreign_key: :gl_project_id
- has_many :ci_builds, class_name: 'Ci::Build', foreign_key: :gl_project_id # the builds are created from the ci_statuses
- has_many :ci_runner_projects, dependent: :destroy, class_name: 'Ci::RunnerProject', foreign_key: :gl_project_id
- has_many :ci_runners, through: :ci_runner_projects, source: :runner, class_name: 'Ci::Runner'
- has_many :ci_variables, dependent: :destroy, class_name: 'Ci::Variable', foreign_key: :gl_project_id
- has_many :ci_triggers, dependent: :destroy, class_name: 'Ci::Trigger', foreign_key: :gl_project_id
+ has_many :builds, class_name: 'Ci::Build', foreign_key: :gl_project_id # the builds are created from the commit_statuses
+ has_many :runner_projects, dependent: :destroy, class_name: 'Ci::RunnerProject', foreign_key: :gl_project_id
+ has_many :runners, through: :runner_projects, source: :runner, class_name: 'Ci::Runner'
+ has_many :variables, dependent: :destroy, class_name: 'Ci::Variable', foreign_key: :gl_project_id
+ has_many :triggers, dependent: :destroy, class_name: 'Ci::Trigger', foreign_key: :gl_project_id
- accepts_nested_attributes_for :ci_variables, allow_destroy: true
+ accepts_nested_attributes_for :variables, allow_destroy: true
delegate :name, to: :owner, allow_nil: true, prefix: true
delegate :members, to: :team, prefix: true
@@ -822,7 +822,7 @@ class Project < ActiveRecord::Base
end
def any_runners?(&block)
- if ci_runners.active.any?(&block)
+ if runners.active.any?(&block)
return true
end
diff --git a/app/models/user.rb b/app/models/user.rb
index da06b6f3ade..87d46a49430 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -134,7 +134,7 @@ class User < ActiveRecord::Base
has_many :assigned_merge_requests, dependent: :destroy, foreign_key: :assignee_id, class_name: "MergeRequest"
has_many :oauth_applications, class_name: 'Doorkeeper::Application', as: :owner, dependent: :destroy
has_one :abuse_report, dependent: :destroy
- has_many :ci_builds, dependent: :nullify, class_name: 'Ci::Build'
+ has_many :builds, dependent: :nullify, class_name: 'Ci::Build'
#