2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-25 13:14:56 -04:00
|
|
|
class WizardSerializer < ApplicationSerializer
|
2020-05-26 13:56:36 -04:00
|
|
|
attributes :start, :completed, :current_color_scheme
|
2016-08-25 13:14:56 -04:00
|
|
|
|
|
|
|
has_many :steps, serializer: WizardStepSerializer, embed: :objects
|
|
|
|
|
|
|
|
def start
|
|
|
|
object.start.id
|
|
|
|
end
|
2018-11-15 14:44:19 -05:00
|
|
|
|
|
|
|
def completed
|
|
|
|
object.completed?
|
|
|
|
end
|
2020-05-26 13:56:36 -04:00
|
|
|
|
|
|
|
def current_color_scheme
|
2020-05-26 16:08:35 -04:00
|
|
|
color_scheme = Theme.where(id: SiteSetting.default_theme_id).first&.color_scheme
|
2021-08-25 17:10:12 -04:00
|
|
|
color_scheme ? color_scheme.colors_hashes : ColorScheme.base.colors_hashes
|
2020-05-26 13:56:36 -04:00
|
|
|
end
|
2016-08-25 13:14:56 -04:00
|
|
|
end
|