Sha256: 9d53a5a7eb6b546d4d2203adaca8cd03069f0b9fb8c4628bf0263c0464a030dd
Contents?: true
Size: 746 Bytes
Versions: 3
Compression:
Stored size: 746 Bytes
Contents
# frozen_string_literal: true module ActsAsRecursiveTree module Options class QueryOptions STRATEGIES = %i[subselect join].freeze def self.from options = new yield(options) if block_given? options end attr_accessor :condition attr_reader :ensure_ordering, :query_strategy def depth @depth ||= DepthCondition.new end def ensure_ordering! @ensure_ordering = true end def depth_present? @depth.present? end def query_strategy=(strategy) raise "invalid strategy #{strategy} - only #{STRATEGIES} are allowed" unless STRATEGIES.include?(strategy) @query_strategy = strategy end end end end
Version data entries
3 entries across 3 versions & 1 rubygems