Don't do multi-line ternary
This commit is contained in:
parent
f012c7dc1f
commit
f4bb87fdce
|
@ -127,8 +127,12 @@ module Ransack
|
||||||
options[:compounds] = true if options[:compounds].nil?
|
options[:compounds] = true if options[:compounds].nil?
|
||||||
default = options.delete(:default) || 'cont'.freeze
|
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)$/) }
|
Predicate.names.reject { |k| k.match(/_(any|all)$/) }
|
||||||
|
end
|
||||||
if only = options[:only]
|
if only = options[:only]
|
||||||
if only.respond_to? :call
|
if only.respond_to? :call
|
||||||
keys = keys.select { |k| only.call(k) }
|
keys = keys.select { |k| only.call(k) }
|
||||||
|
|
Loading…
Reference in New Issue