Sha256: 91950adc2fb7af9a4130f2fe148f2bd9c66547c120143c8b18819ba7d83d8366

Contents?: true

Size: 854 Bytes

Versions: 5

Compression:

Stored size: 854 Bytes

Contents

module Searchlogic
  module Condition
    class NotEqual < Base
      self.handle_array_value = true
      self.ignore_meaningless_value = false
      
      class << self
        def condition_names_for_column
          super + ["does_not_equal", "not_equal", "is_not", "not", "ne"]
        end
      end
      
      def to_conditions(value)
        # Delegate to equals and then change
        condition = Equals.new(klass, options)
        condition.value = value
        conditions_array = condition.sanitize
        return conditions_array if conditions_array.blank?
        conditions_array.first.gsub!(/ IS /, " IS NOT ")
        conditions_array.first.gsub!(/ BETWEEN /, " NOT BETWEEN ")
        conditions_array.first.gsub!(/ IN /, " NOT IN ")
        conditions_array.first.gsub!(/=/, "!=")
        conditions_array
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
schof-searchlogic-0.0.2 lib/searchlogic/condition/not_equal.rb
searchlogic-1.6.3 lib/searchlogic/condition/not_equal.rb
searchlogic-1.6.4 lib/searchlogic/condition/not_equal.rb
searchlogic-1.6.5 lib/searchlogic/condition/not_equal.rb
searchlogic-1.6.6 lib/searchlogic/condition/not_equal.rb