diff --git a/app/models/concerns/routable.rb b/app/models/concerns/routable.rb
index d36bb9da29683ff497b9fac69e4b219fc6b625d2..1108a64c59e7e06e2c9984939a4c290941e78d15 100644
--- a/app/models/concerns/routable.rb
+++ b/app/models/concerns/routable.rb
@@ -7,6 +7,7 @@ module Routable
     has_one :route, as: :source, autosave: true, dependent: :destroy
 
     validates_associated :route
+    validates :route, presence: true
 
     before_validation :update_route_path, if: :full_path_changed?
   end
@@ -28,17 +29,17 @@ module Routable
 
       order_sql = "(CASE WHEN #{binary} routes.path = #{connection.quote(path)} THEN 0 ELSE 1 END)"
 
-      where_paths_in([path]).reorder(order_sql).take
+      where_full_path_in([path]).reorder(order_sql).take
     end
 
     # Builds a relation to find multiple objects by their full paths.
     #
     # Usage:
     #
-    #     Klass.where_paths_in(%w{gitlab-org/gitlab-ce gitlab-org/gitlab-ee})
+    #     Klass.where_full_path_in(%w{gitlab-org/gitlab-ce gitlab-org/gitlab-ee})
     #
     # Returns an ActiveRecord::Relation.
-    def where_paths_in(paths)
+    def where_full_path_in(paths)
       wheres = []
       cast_lower = Gitlab::Database.postgresql?
 
diff --git a/lib/banzai/filter/abstract_reference_filter.rb b/lib/banzai/filter/abstract_reference_filter.rb
index d904a8bd4ae48724ea37128ea3d590a262d62ee9..fd74eeaebe7df719b5a2698dc3536ad45bd8f987 100644
--- a/lib/banzai/filter/abstract_reference_filter.rb
+++ b/lib/banzai/filter/abstract_reference_filter.rb
@@ -248,7 +248,7 @@ module Banzai
       end
 
       def projects_relation_for_paths(paths)
-        Project.where_paths_in(paths).includes(:namespace)
+        Project.where_full_path_in(paths).includes(:namespace)
       end
 
       # Returns projects for the given paths.
diff --git a/spec/factories/groups.rb b/spec/factories/groups.rb
index ebd3595ea641b4a26757f131c0f67f9b44abe728..ece6beb9fa961bccaf824e93a974eeb70ffdaf06 100644
--- a/spec/factories/groups.rb
+++ b/spec/factories/groups.rb
@@ -19,5 +19,9 @@ FactoryGirl.define do
     trait :access_requestable do
       request_access_enabled true
     end
+
+    trait :nested do
+      parent factory: :group
+    end
   end
 end
diff --git a/spec/models/concerns/routable_spec.rb b/spec/models/concerns/routable_spec.rb
index 0acefc0c1d5f627ad4acf8a7acd8a8724707e498..b556135532f3b725e21d3531ff71a157a1b19e75 100644
--- a/spec/models/concerns/routable_spec.rb
+++ b/spec/models/concerns/routable_spec.rb
@@ -3,6 +3,10 @@ require 'spec_helper'
 describe Group, 'Routable' do
   let!(:group) { create(:group) }
 
+  describe 'Validations' do
+    it { is_expected.to validate_presence_of(:route) }
+  end
+
   describe 'Associations' do
     it { is_expected.to have_one(:route).dependent(:destroy) }
   end
@@ -35,16 +39,16 @@ describe Group, 'Routable' do
     it { expect(described_class.find_by_full_path('unknown')).to eq(nil) }
   end
 
-  describe '.where_paths_in' do
+  describe '.where_full_path_in' do
     context 'without any paths' do
       it 'returns an empty relation' do
-        expect(described_class.where_paths_in([])).to eq([])
+        expect(described_class.where_full_path_in([])).to eq([])
       end
     end
 
     context 'without any valid paths' do
       it 'returns an empty relation' do
-        expect(described_class.where_paths_in(%w[unknown])).to eq([])
+        expect(described_class.where_full_path_in(%w[unknown])).to eq([])
       end
     end
 
@@ -52,13 +56,13 @@ describe Group, 'Routable' do
       let!(:nested_group) { create(:group, parent: group) }
 
       it 'returns the projects matching the paths' do
-        result = described_class.where_paths_in([group.to_param, nested_group.to_param])
+        result = described_class.where_full_path_in([group.to_param, nested_group.to_param])
 
         expect(result).to contain_exactly(group, nested_group)
       end
 
       it 'returns projects regardless of the casing of paths' do
-        result = described_class.where_paths_in([group.to_param.upcase, nested_group.to_param.upcase])
+        result = described_class.where_full_path_in([group.to_param.upcase, nested_group.to_param.upcase])
 
         expect(result).to contain_exactly(group, nested_group)
       end
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
index 1613a586a2c428ca79c8c114670dea717c378e06..850b1a3cf1ecf0937fd4dee8529bf10ce46e67ff 100644
--- a/spec/models/group_spec.rb
+++ b/spec/models/group_spec.rb
@@ -271,4 +271,11 @@ describe Group, models: true do
       expect(group.web_url).to include("groups/#{group.name}")
     end
   end
+
+  describe 'nested group' do
+    subject { create(:group, :nested) }
+
+    it { is_expected.to be_valid }
+    it { expect(subject.parent).to be_kind_of(Group) }
+  end
 end