No need for nil checking in commit #7597f0d

This commit is contained in:
jonatack 2013-08-16 21:04:37 +02:00
parent 987d49f2c4
commit 69ee4da6e1
1 changed files with 1 additions and 3 deletions

View File

@ -14,12 +14,10 @@ module Ransack
:translate, to: :base
def initialize(object, params = {}, options = {})
params ||= {}
(params ||= {}).delete_if { |k, v| v.blank? && v != false }
@context = Context.for(object, options)
@context.auth_object = options[:auth_object]
@base = Nodes::Grouping.new(@context, 'and')
params = (params.delete_if { |k, v| v.blank? && v != false }
) if params.present?
build(params.with_indifferent_access)
end