Sha256: 53ce4ed5e430e51c5ad47fea523387ebb43b6dcb5a7900d881385230e04e3643

Contents?: true

Size: 433 Bytes

Versions: 9

Compression:

Stored size: 433 Bytes

Contents

# Filter for booleans

class MultiSolr::SolrFilterBoolean < MultiSolr::SolrFilterSimple



  # Erzeugen des SolR-Query-Strings
  def build_solr_query value
    return nil if value.blank?
    "#{@field_name}:#{to_bool(value)}"
  end


  def render_value value, options=nil
    to_bool(value) ? 'yes' : 'no'
  end


  private


  def to_bool value
    value && (value == true || value=='1' || value==1 || value=='true')
  end

end




Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
multi-solr-01.12.00 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.11.01 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.11.00 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.10.00 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.09.05 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.09.04 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.09.03 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.09.02 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.09.01 lib/multi_solr/solr_filter_boolean.rb