def conditions_from_params
      @conditions_from_params ||= begin
        conditions = {}
        params.except(:controller, :action, :page, :sort, :sort_direction, :format, :id).each do |key, value|
          column = active_scaffold_config._columns_hash[key.to_s]
          next unless column
          key = key.to_sym
          not_string = %i[string text].exclude?(column.type)
          next if active_scaffold_constraints[key]
          next if nested? && nested.param_name == key

          range = %i[date datetime].include?(column.type) && value.is_a?(String) && value.scan('..').size == 1
          value = value.split('..') if range
          conditions[key] =
            if value.is_a?(Array)
              value.map { |v| v == '' && not_string ? nil : ActiveScaffold::Core.column_type_cast(v, column) }
            elsif value == '' && (not_string || column.null)
              ActiveScaffold::Core.column_type_cast(column.default, column)
            else
              ActiveScaffold::Core.column_type_cast(value, column)
            end
          conditions[key] = Range.new(*conditions[key]) if range
        end
        conditions
      end
    end
def conditions_from_params
      @conditions_from_params ||= begin
        conditions = {}
        params.except(:controller, :action, :page, :sort, :sort_direction, :format, :id).each do |key, value|
          column = active_scaffold_config._columns_hash[key.to_s]
          next unless column
          key = key.to_sym
          not_string = %i[string text].exclude?(column.type)
          next if active_scaffold_constraints[key]
          next if nested? && nested.param_name == key

          range = %i[date datetime].include?(column.type) && value.is_a?(String) && value.scan('..').size == 1
          value = value.split('..') if range
          conditions[key] =
            if value.is_a?(Array)
              value.map { |v| v == '' && not_string ? nil : ActiveScaffold::Core.column_type_cast(v, column) }
            elsif value == '' && (not_string || column.null)
              ActiveScaffold::Core.column_type_cast(column.default, column)
            else
              ActiveScaffold::Core.column_type_cast(value, column)
            end
          conditions[key] = Range.new(*conditions[key]) if range
        end
        conditions
      end
    end
Builds search conditions by search params for column names. This allows urls like "contacts/list?company_id=5".