Skip to content
This repository has been archived by the owner on Jan 31, 2018. It is now read-only.

Commit

Permalink
Minor bugfix - you can't .downcase a true/false value...
Browse files Browse the repository at this point in the history
  • Loading branch information
Daz Oakley committed Feb 16, 2011
1 parent 1659e7d commit bdabedf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/biomart/dataset.rb
Expand Up @@ -251,9 +251,10 @@ 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.downcase)
value = value.downcase if value.is_a? String
if [true,'included','only'].include?(value)
xml.Filter( :name => name, :excluded => '0' )
elsif [false,'excluded'].include?(value.downcase)
elsif [false,'excluded'].include?(value)
xml.Filter( :name => name, :excluded => '1' )
else
raise Biomart::ArgumentError, "The boolean filter '#{name}' can only accept 'true/included/only' or 'false/excluded' arguments."
Expand Down

0 comments on commit bdabedf

Please sign in to comment.