DEV: Prefer `create!` over `create` when not checking return value.
This commit is contained in:
parent
626808e100
commit
414a36184b
|
@ -7,13 +7,15 @@ if !Theme.exists?
|
||||||
dark_scheme ||= ColorScheme.create_from_base(name: name, via_wizard: true, base_scheme_id: "Dark")
|
dark_scheme ||= ColorScheme.create_from_base(name: name, via_wizard: true, base_scheme_id: "Dark")
|
||||||
|
|
||||||
name = I18n.t('color_schemes.dark_theme_name')
|
name = I18n.t('color_schemes.dark_theme_name')
|
||||||
_dark_theme = Theme.create(name: name, user_id: -1,
|
|
||||||
color_scheme_id: dark_scheme.id,
|
_dark_theme = Theme.create!(
|
||||||
user_selectable: true)
|
name: name, user_id: -1,
|
||||||
|
color_scheme_id: dark_scheme.id,
|
||||||
|
user_selectable: true
|
||||||
|
)
|
||||||
|
|
||||||
name = I18n.t('color_schemes.default_theme_name')
|
name = I18n.t('color_schemes.default_theme_name')
|
||||||
default_theme = Theme.create(name: name, user_id: -1,
|
default_theme = Theme.create!(name: name, user_id: -1, user_selectable: true)
|
||||||
user_selectable: true)
|
|
||||||
|
|
||||||
default_theme.set_default!
|
default_theme.set_default!
|
||||||
end
|
end
|
||||||
|
|
|
@ -167,7 +167,12 @@ class Wizard
|
||||||
theme = themes.find(&:default?)
|
theme = themes.find(&:default?)
|
||||||
theme ||= themes.first
|
theme ||= themes.first
|
||||||
|
|
||||||
theme ||= Theme.create(name: name, user_id: @wizard.user.id, color_scheme_id: scheme.id)
|
theme ||= Theme.create!(
|
||||||
|
name: name,
|
||||||
|
user_id: @wizard.user.id,
|
||||||
|
color_scheme_id: scheme.id
|
||||||
|
)
|
||||||
|
|
||||||
theme.set_default!
|
theme.set_default!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue