Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2019-04-20 16:27:53 +0300
committerStan Hu <stanhu@gmail.com>2019-04-20 16:27:53 +0300
commita02e22438de38e4eca64e45c324af10626b3975c (patch)
treee4b6118887e52c14e9c8847de7eb9b1cb38b523e /app/models/pool_repository.rb
parent9c2b37d7c4621f8284530565fa1d361b12502715 (diff)
Fix wrong use of ActiveRecord in PoolRepository
Diffstat (limited to 'app/models/pool_repository.rb')
-rw-r--r--app/models/pool_repository.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/pool_repository.rb b/app/models/pool_repository.rb
index 7934118761e..50eed7344bd 100644
--- a/app/models/pool_repository.rb
+++ b/app/models/pool_repository.rb
@@ -7,7 +7,7 @@ class PoolRepository < ApplicationRecord
include Shardable
include AfterCommitQueue
- has_one :source_project, class_name: 'Project'
+ belongs_to :source_project, class_name: 'Project'
validates :source_project, presence: true
has_many :member_projects, class_name: 'Project'
@@ -99,7 +99,8 @@ class PoolRepository < ApplicationRecord
end
def inspect
- "#<#{self.class.name} id:#{id} state:#{state} disk_path:#{disk_path} source_project: #{source_project.full_path}>"
+ source = source_project ? source_project.full_path : 'nil'
+ "#<#{self.class.name} id:#{id} state:#{state} disk_path:#{disk_path} source_project: #{source}>"
end
private