Fix all the errors to get our tests green on Rails 5.1.

This commit is contained in:
Guo Xiang Tan
2017-08-31 12:06:56 +08:00
parent 898ee93547
commit 77d4c4d8dc
989 changed files with 5114 additions and 3117 deletions

View File

@ -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,