diff options
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r-- | app/models/snippet.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 00931457344..b2fca65b9e0 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -55,6 +55,7 @@ class Snippet < ApplicationRecord scope :are_public, -> { where(visibility_level: Snippet::PUBLIC) } scope :public_and_internal, -> { where(visibility_level: [Snippet::PUBLIC, Snippet::INTERNAL]) } scope :fresh, -> { order("created_at DESC") } + scope :inc_author, -> { includes(:author) } scope :inc_relations_for_view, -> { includes(author: :status) } participant :author |