mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
Add rubocop to our build. (#5004)
This commit is contained in:
@ -62,7 +62,7 @@ class Admin::ThemesController < Admin::AdminController
|
||||
}
|
||||
|
||||
respond_to do |format|
|
||||
format.json { render json: payload}
|
||||
format.json { render json: payload }
|
||||
end
|
||||
end
|
||||
|
||||
@ -77,7 +77,7 @@ class Admin::ThemesController < Admin::AdminController
|
||||
if @theme.save
|
||||
update_default_theme
|
||||
log_theme_change(nil, @theme)
|
||||
format.json { render json: @theme, status: :created}
|
||||
format.json { render json: @theme, status: :created }
|
||||
else
|
||||
format.json { render json: @theme.errors, status: :unprocessable_entity }
|
||||
end
|
||||
@ -100,7 +100,7 @@ class Admin::ThemesController < Admin::AdminController
|
||||
|
||||
@theme.child_theme_relation.to_a.each do |child|
|
||||
if expected.include?(child.child_theme_id)
|
||||
expected.reject!{|id| id == child.child_theme_id}
|
||||
expected.reject! { |id| id == child.child_theme_id }
|
||||
else
|
||||
child.destroy
|
||||
end
|
||||
@ -133,12 +133,12 @@ class Admin::ThemesController < Admin::AdminController
|
||||
update_default_theme
|
||||
|
||||
log_theme_change(original_json, @theme)
|
||||
format.json { render json: @theme, status: :created}
|
||||
format.json { render json: @theme, status: :created }
|
||||
else
|
||||
format.json {
|
||||
|
||||
error = @theme.errors[:color_scheme] ? I18n.t("themes.bad_color_scheme") : I18n.t("themes.other_error")
|
||||
render json: {errors: [ error ]}, status: :unprocessable_entity
|
||||
render json: { errors: [ error ] }, status: :unprocessable_entity
|
||||
}
|
||||
end
|
||||
end
|
||||
@ -192,13 +192,14 @@ class Admin::ThemesController < Admin::AdminController
|
||||
begin
|
||||
# deep munge is a train wreck, work around it for now
|
||||
params[:theme][:child_theme_ids] ||= [] if params[:theme].key?(:child_theme_ids)
|
||||
params.require(:theme)
|
||||
.permit(:name,
|
||||
:color_scheme_id,
|
||||
:default,
|
||||
:user_selectable,
|
||||
theme_fields: [:name, :target, :value, :upload_id, :type_id],
|
||||
child_theme_ids: [])
|
||||
params.require(:theme).permit(
|
||||
:name,
|
||||
:color_scheme_id,
|
||||
:default,
|
||||
:user_selectable,
|
||||
theme_fields: [:name, :target, :value, :upload_id, :type_id],
|
||||
child_theme_ids: []
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user