Sha256: c624aa57f6bfb5b4363218ae6385b446627bcca956fddf266ab753135ebe49f8

Contents?: true

Size: 402 Bytes

Versions: 7

Compression:

Stored size: 402 Bytes

Contents

module Searchlogic
  module Condition
    class InclusiveDescendantOf < NestedSet
      def to_conditions(value)
        root = (value.is_a?(klass) ? value : klass.find(value)) rescue return
        ["(#{quoted_table_name}.#{quote_column_name(klass.left_column_name)} >= ? AND #{quoted_table_name}.#{quote_column_name(klass.right_column_name)} <= ?)", root.left, root.right]
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
schof-searchlogic-0.0.2 lib/searchlogic/condition/inclusive_descendant_of.rb
searchlogic-1.6.1 lib/searchlogic/condition/inclusive_descendant_of.rb
searchlogic-1.6.4 lib/searchlogic/condition/inclusive_descendant_of.rb
searchlogic-1.6.5 lib/searchlogic/condition/inclusive_descendant_of.rb
searchlogic-1.6.6 lib/searchlogic/condition/inclusive_descendant_of.rb
searchlogic-1.6.3 lib/searchlogic/condition/inclusive_descendant_of.rb
searchlogic-1.6.2 lib/searchlogic/condition/inclusive_descendant_of.rb