DEV: Prefer create! over create when not checking return value.

This commit is contained in:
Guo Xiang Tan
2019-05-09 15:10:24 +08:00
parent 626808e100
commit 414a36184b
2 changed files with 13 additions and 6 deletions

View File

@ -167,7 +167,12 @@ class Wizard
theme = themes.find(&:default?)
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!
end
end