app/models/searchable.rb
# Build the payload to pass to the search index
Build the payload to pass to the search index
Build the payload to pass to the search index
def search_index
      SEARCH_FIELDS.each_with_object({}) do |name, result|
        value = searchable_options[name].call(self)
        key = KEY_MAPPING[name] || name.to_s
        result[key] = value unless value.nil?
      end
    end
def search_index SEARCH_FIELDS . each_with_object ( { } ) do | name , result | value = searchable_options [ name ] . call ( self ) key = KEY_MAPPING [ name ] || name . to_s result [ key ] = value unless value . nil? end end
Build the payload to pass to the search index
Build the payload to pass to the search index