Make Mentionable#cross_reference_exists? private.
This commit is contained in:
		
							parent
							
								
									530f0d71f5
								
							
						
					
					
						commit
						276b3a7bc2
					
				| 
						 | 
				
			
			@ -41,12 +41,6 @@ module Mentionable
 | 
			
		|||
    self
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # Determine whether or not a cross-reference Note has already been created between this Mentionable and
 | 
			
		||||
  # the specified target.
 | 
			
		||||
  def cross_reference_exists?(target)
 | 
			
		||||
    SystemNoteService.cross_reference_exists?(target, local_reference)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def all_references(current_user = self.author, text = self.mentionable_text)
 | 
			
		||||
    ext = Gitlab::ReferenceExtractor.new(self.project, current_user)
 | 
			
		||||
    ext.analyze(text)
 | 
			
		||||
| 
						 | 
				
			
			@ -111,4 +105,10 @@ module Mentionable
 | 
			
		|||
    # Only include changed fields that are mentionable
 | 
			
		||||
    source.select { |key, val| mentionable.include?(key) }
 | 
			
		||||
  end
 | 
			
		||||
  
 | 
			
		||||
  # Determine whether or not a cross-reference Note has already been created between this Mentionable and
 | 
			
		||||
  # the specified target.
 | 
			
		||||
  def cross_reference_exists?(target)
 | 
			
		||||
    SystemNoteService.cross_reference_exists?(target, local_reference)
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -86,13 +86,6 @@ shared_examples 'a mentionable' do
 | 
			
		|||
 | 
			
		||||
    subject.create_cross_references!
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  it 'detects existing cross-references' do
 | 
			
		||||
    SystemNoteService.cross_reference(mentioned_issue, subject.local_reference, author)
 | 
			
		||||
 | 
			
		||||
    expect(subject.cross_reference_exists?(mentioned_issue)).to be_truthy
 | 
			
		||||
    expect(subject.cross_reference_exists?(mentioned_mr)).to be_falsey
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
shared_examples 'an editable mentionable' do
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue