Class: NotePolicy

Inherits:
BasePolicy
  • Object
show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
app/policies/note_policy.rb

Instance Method Summary collapse

Instance Method Details

#parent_namespaceObject



102
103
104
105
106
107
108
109
# File 'app/policies/note_policy.rb', line 102

def parent_namespace
  strong_memoize(:parent_namespace) do
    next if @subject.is_a?(PersonalSnippet)
    next @subject.noteable.group if @subject.noteable.is_a?(Epic)

    @subject.project
  end
end