Sha256: 6f3a4c2c258266a5e730ed6a5f63e4b153cf1d3bab99ab8139e948ad19cc0d50

Contents?: true

Size: 510 Bytes

Versions: 2

Compression:

Stored size: 510 Bytes

Contents

module Gamefic
  module Query
    class Family < Base
      def context_from(subject)
        result = []
        top = subject.parent
        unless top.nil?
          #until top.parent.nil?
          #  top = top.parent
          #end
          result.concat subquery_accessible(top)
        end
        result.delete subject
        subject.children.each { |c|
          result.push c
          result.concat subquery_accessible(c)
        }
        result
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gamefic-1.7.0 lib/gamefic/query/family.rb
gamefic-1.6.0 lib/gamefic/query/family.rb