Sha256: 1daa1762c4db4ea9f3fb89ffca3ea7ead0289cceaadea1ee8c96c4ebcbfdd237
Contents?: true
Size: 487 Bytes
Versions: 95
Compression:
Stored size: 487 Bytes
Contents
# frozen_string_literal: true module Renalware module Snippets class SnippetQuery attr_reader :author, :relation def initialize(relation: nil, author:) @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
95 entries across 95 versions & 1 rubygems