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