Sha256: dc076cc8579dfebd54bb03e6781a1c503d1f9b489fbcfc074065b8dfa5283cbe
Contents?: true
Size: 497 Bytes
Versions: 39
Compression:
Stored size: 497 Bytes
Contents
# frozen_string_literal: true module Renalware module Snippets class SnippetQuery attr_reader :author, :relation def initialize(relation: nil, author:) @relation = relation || Snippet.includes(:author).all @author = author end def call snippets end private def snippets if author.present? relation.where(author_id: author.id) else relation.all end end end end end
Version data entries
39 entries across 39 versions & 1 rubygems