Refactor conditional

This commit is contained in:
Chris Salzberg 2018-05-03 10:04:47 +09:00
parent 581bcd8a78
commit ee5969dc3f
No known key found for this signature in database
GPG Key ID: C0C7B09832CB1CB1
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)