Class: Checkoff::Internal::SearchUrl::CustomFieldVariant::NoValue

Inherits:
CustomFieldVariant show all
Defined in:
lib/checkoff/internal/search_url/custom_field_variant.rb

Overview

custom_field_#CustomFieldVariant#gid.variant = ‘no_value’

Instance Method Summary collapse

Methods inherited from CustomFieldVariant

#initialize

Constructor Details

This class inherits a constructor from Checkoff::Internal::SearchUrl::CustomFieldVariant::CustomFieldVariant

Instance Method Details

#convertArray<(Hash, Array)>

Returns:

  • (Array<(Hash, Array)>)


148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/checkoff/internal/search_url/custom_field_variant.rb', line 148

def convert
  ensure_no_remaining_params!

  api_params = { "custom_fields.#{gid}.is_set" => 'false' }
  # As of 2023-02, the 'is_set' => 'false' seems to not do
  # the intuitive thing on multi-select fields; it either
  # operates as a no-op or operates the same as 'true'; not
  # sure.
  #
  # Let's handle those with a filter afterwards.
  task_selector = [:nil?, [:custom_field_gid_value, gid]]
  [api_params, task_selector]
end