Refactor conditional
This commit is contained in:
parent
581bcd8a78
commit
ee5969dc3f
|
@ -49,11 +49,7 @@ module Ransack
|
|||
alias :c= :conditions=
|
||||
|
||||
def [](key)
|
||||
if condition = conditions.detect { |c| c.key == key.to_s }
|
||||
condition
|
||||
else
|
||||
nil
|
||||
end
|
||||
conditions.detect { |c| c.key == key.to_s }
|
||||
end
|
||||
|
||||
def []=(key, value)
|
||||
|
|
Loading…
Reference in New Issue