diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-04-23 18:48:26 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-04-23 18:48:26 +0300 |
commit | ab286656b22dd686a659afe908daade6e5a54ff3 (patch) | |
tree | 538fb10cb2979c616754e492d8fe44500e760a37 /app/models/concerns | |
parent | 3d12ce95b1307f9b8439aab9ac5fe9d406ab9b01 (diff) |
Resolve "Namespace factory is problematic"
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/routable.rb | 7 |
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 |