Chiavi I18n visualizzate sulla pagina di modifica dei Webhooks

Ottima osservazione!

Non dovresti vedere il webhook di un plugin non installato sul tuo Discourse.

Questa è una regressione da qui:

Nello specifico qui.
I simboli forniti in TYPES non corrispondono ai valori dell’elenco:

Al team, ecco una possibile soluzione:
def self.types_with_prefix(prefix)
  TYPES.select { |key, _value| key.to_s.start_with?(prefix.to_s) }.values
end

def self.active
  ids_to_exclude = []
  unless defined?(SiteSetting.solved_enabled) && SiteSetting.solved_enabled
    ids_to_exclude.concat(types_with_prefix(:solved))
  end
  unless defined?(SiteSetting.assign_enabled) && SiteSetting.assign_enabled
    ids_to_exclude.concat(types_with_prefix(:assign))
  end
  unless defined?(SiteSetting.voting_enabled) && SiteSetting.voting_enabled
    ids_to_exclude.concat(types_with_prefix(:voting_topic))
  end
  unless defined?(SiteSetting.chat_enabled) && SiteSetting.chat_enabled
    ids_to_exclude.concat(types_with_prefix(:chat_message))
  end
  self.where.not(id: ids_to_exclude.flatten)
end
6 Mi Piace