0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 01:10:28 +01:00

DEV: handle add_to_serializer deprecations

Dieser Commit ist enthalten in:
Angus McLeod 2024-06-20 09:38:37 +02:00
Ursprung 883bd6d96c
Commit 153435950a

Datei anzeigen

@ -1,7 +1,7 @@
# frozen_string_literal: true
# name: discourse-custom-wizard
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
# version: 2.6.10
# version: 2.6.11
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos
# url: https://github.com/paviliondev/discourse-custom-wizard
# contact_emails: development@pavilion.tech
@ -185,17 +185,17 @@ after_initialize do
end
end
add_to_serializer(:site, :include_wizard_required?) do
add_to_class(:site_serializer, :include_wizard_required?) do
scope.is_admin? && Wizard.new(scope.user).requires_completion?
end
add_to_serializer(:site, :complete_custom_wizard) do
add_to_class(:site_serializer, :complete_custom_wizard) do
if scope.user && requires_completion = CustomWizard::Wizard.prompt_completion(scope.user)
requires_completion.map { |w| { name: w[:name], url: "/w/#{w[:id]}" } }
end
end
add_to_serializer(:site, :include_complete_custom_wizard?) do
add_to_class(:site_serializer, :include_complete_custom_wizard?) do
complete_custom_wizard.present?
end