Sha256: 2432d74a017a0416b0b7326d14db35529cf9c87ad7e5948e8bb824483ab8ce4a

Contents?: true

Size: 339 Bytes

Versions: 8

Compression:

Stored size: 339 Bytes

Contents

# frozen_string_literal: true

module Gamefic
  module Scope
    # The Children scope returns an entity's children and all accessible
    # descendants.
    #
    class Children < Base
      def matches
        context.children.flat_map do |c|
          [c] + subquery_accessible(c)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gamefic-3.6.0 lib/gamefic/scope/children.rb
gamefic-3.5.0 lib/gamefic/scope/children.rb
gamefic-3.4.0 lib/gamefic/scope/children.rb
gamefic-3.3.0 lib/gamefic/scope/children.rb
gamefic-3.2.1 lib/gamefic/scope/children.rb
gamefic-3.2.0 lib/gamefic/scope/children.rb
gamefic-3.1.0 lib/gamefic/scope/children.rb
gamefic-3.0.0 lib/gamefic/scope/children.rb