Don't do multi-line ternary

This commit is contained in:
Jon Atack 2014-11-05 19:42:30 +01:00
parent f012c7dc1f
commit f4bb87fdce
1 changed files with 5 additions and 1 deletions

View File

@ -127,8 +127,12 @@ module Ransack
options[:compounds] = true if options[:compounds].nil?
default = options.delete(:default) || 'cont'.freeze
keys = options[:compounds] ? Predicate.names :
keys =
if options[:compounds]
Predicate.names
else
Predicate.names.reject { |k| k.match(/_(any|all)$/) }
end
if only = options[:only]
if only.respond_to? :call
keys = keys.select { |k| only.call(k) }