Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Handle boolean filters when set on as default

  • Loading branch information...
commit aa7c0996e5b15a5352e5e187e53350ec4b228bca 1 parent 73a5a59
Daz Oakley authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/biomart/dataset.rb
View
10 lib/biomart/dataset.rb
@@ -251,9 +251,9 @@ def dataset_xml( xml, dataset, args )
raise Biomart::ArgumentError, "The filter '#{name}' does not exist" if dataset.filters[name].nil?
if dataset.filters[name].type == 'boolean'
- if [true,'included','only'].include?(value)
+ if [true,'included','only'].include?(value.downcase)
xml.Filter( :name => name, :excluded => '0' )
- elsif [false,'excluded'].include?(value)
+ elsif [false,'excluded'].include?(value.downcase)
xml.Filter( :name => name, :excluded => '1' )
else
raise Biomart::ArgumentError, "The boolean filter '#{name}' can only accept 'true/included/only' or 'false/excluded' arguments."
@@ -266,7 +266,11 @@ def dataset_xml( xml, dataset, args )
else
dataset.filters.each do |name,filter|
if filter.default?
- xml.Filter( :name => name, :value => filter.default_value )
+ if filter.type == 'boolean'
+ xml.Filter( :name => name, :excluded => filter.default_value )
+ else
+ xml.Filter( :name => name, :value => filter.default_value )
+ end
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.