summaryrefslogtreecommitdiff
path: root/app/models/concerns/routable.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-04-23 15:48:26 +0000
committerNick Thomas <nick@gitlab.com>2018-04-23 15:48:26 +0000
commitab286656b22dd686a659afe908daade6e5a54ff3 (patch)
tree538fb10cb2979c616754e492d8fe44500e760a37 /app/models/concerns/routable.rb
parent3d12ce95b1307f9b8439aab9ac5fe9d406ab9b01 (diff)
downloadgitlab-ce-ab286656b22dd686a659afe908daade6e5a54ff3.tar.gz
Resolve "Namespace factory is problematic"
Diffstat (limited to 'app/models/concerns/routable.rb')
-rw-r--r--app/models/concerns/routable.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/concerns/routable.rb b/app/models/concerns/routable.rb
index dfd7d94450b..915ad6959be 100644
--- a/app/models/concerns/routable.rb
+++ b/app/models/concerns/routable.rb
@@ -102,7 +102,7 @@ module Routable
# the route. Caching this per request ensures that even if we have multiple instances,
# we will not have to duplicate work, avoiding N+1 queries in some cases.
def full_path
- return uncached_full_path unless RequestStore.active?
+ return uncached_full_path unless RequestStore.active? && persisted?
RequestStore[full_path_key] ||= uncached_full_path
end
@@ -124,6 +124,11 @@ module Routable
end
end
+ # Group would override this to check from association
+ def owned_by?(user)
+ owner == user
+ end
+
private
def set_path_errors