Merge pull request #915 from shioyama/refactor_conditional

Refactor conditional
This commit is contained in:
Sean 2018-05-09 16:47:26 +02:00 committed by GitHub
commit 21aa9d7928
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -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)