mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 23:31:18 +08:00
Fix all the errors to get our tests green on Rails 5.1.
This commit is contained in:
@ -2,7 +2,7 @@ require_dependency 'upload_creator'
|
||||
|
||||
class Admin::ThemesController < Admin::AdminController
|
||||
|
||||
skip_before_filter :check_xhr, only: [:show, :preview]
|
||||
skip_before_action :check_xhr, only: [:show, :preview]
|
||||
|
||||
def preview
|
||||
@theme = Theme.find(params[:id])
|
||||
@ -179,9 +179,10 @@ class Admin::ThemesController < Admin::AdminController
|
||||
def update_default_theme
|
||||
if theme_params.key?(:default)
|
||||
is_default = theme_params[:default]
|
||||
if @theme.key == SiteSetting.default_theme_key && !is_default
|
||||
|
||||
if @theme.key == SiteSetting.default_theme_key && is_default == "false"
|
||||
Theme.clear_default!
|
||||
elsif is_default
|
||||
elsif is_default == "true"
|
||||
@theme.set_default!
|
||||
end
|
||||
end
|
||||
@ -192,6 +193,7 @@ 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,
|
||||
|
Reference in New Issue
Block a user