Sha256: 22da3999a1786ed6964e57dfd63da67d3840c428a44b717ad369dbeace10bcfb

Contents?: true

Size: 612 Bytes

Versions: 9

Compression:

Stored size: 612 Bytes

Contents

module Searchgasm
  module Condition
    class Equals < Base
      self.handle_array_value = true
      self.ignore_meaningless_value = false
      
      class << self
        def condition_names_for_column
          super + ["", "is"]
        end
      end
      
      def to_conditions(value)
        # Let ActiveRecord handle this
        args = []
        case value
        when Range
          args = [value.first, value.last]
        else
          args << value
        end
                        
        ["#{column_sql} #{klass.send(:attribute_condition, value)}", *args]
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
searchgasm-1.3.3 lib/searchgasm/condition/equals.rb
searchgasm-1.3.4 lib/searchgasm/condition/equals.rb
searchgasm-1.3.5 lib/searchgasm/condition/equals.rb
searchgasm-1.5.1 lib/searchgasm/condition/equals.rb
searchgasm-1.5.3 lib/searchgasm/condition/equals.rb
searchgasm-1.5.2 lib/searchgasm/condition/equals.rb
searchgasm-1.4.0 lib/searchgasm/condition/equals.rb
searchgasm-1.5.0 lib/searchgasm/condition/equals.rb
searchgasm-1.4.1 lib/searchgasm/condition/equals.rb