Commit 50d29b6b authored by Toon Claes's avatar Toon Claes

Add inverse_of:

parent 4c1c6d44
......@@ -189,7 +189,7 @@ class Project < ActiveRecord::Base
has_one :import_state, autosave: true, class_name: 'ProjectImportState', inverse_of: :project
has_one :import_export_upload, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
has_one :project_repository
has_one :project_repository, inverse_of: :project
# Merge Requests for target project should be removed with it
has_many :merge_requests, foreign_key: 'target_project_id', inverse_of: :target_project
......
......@@ -3,7 +3,7 @@
class ProjectRepository < ActiveRecord::Base
include RepositoryOnShard
belongs_to :project
belongs_to :project, inverse_of: :project_repository
class << self
def find_project(disk_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment