vendor/riddle/lib/riddle/configuration/section.rb in pixeltrix-thinking-sphinx-1.1.5 vs vendor/riddle/lib/riddle/configuration/section.rb in pixeltrix-thinking-sphinx-1.2.1
- old
+ new
@@ -19,19 +19,25 @@
}.collect { |setting|
if send(setting) == ""
conf = " #{setting} = "
else
conf = setting_to_array(setting).collect { |set|
- " #{setting} = #{set}"
+ " #{setting} = #{set}"
}
end
conf.length == 0 ? nil : conf
}.flatten.compact
end
def setting_to_array(setting)
value = send(setting)
- value.is_a?(Array) ? value : [value]
+ case value
+ when Array then value
+ when TrueClass then [1]
+ when FalseClass then [0]
+ else
+ [value]
+ end
end
end
end
end