diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 680289d..803d135 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -24,8 +24,4 @@ class ApplicationController < ActionController::API ] }, status: :forbidden end - - def deserialize_params(opts) - ActiveModelSerializers::Deserialization.jsonapi_parse(params, opts) - end end diff --git a/app/controllers/match_scores_controller.rb b/app/controllers/match_scores_controller.rb index 2f62bfc..daffca8 100644 --- a/app/controllers/match_scores_controller.rb +++ b/app/controllers/match_scores_controller.rb @@ -28,6 +28,6 @@ class MatchScoresController < ApplicationController # Only allow a trusted parameter "white list" through. def match_score_params - deserialize_params only: %i[points] + params.require(:match_score).permit(:points) end end diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index 5687b2f..d15e841 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -3,6 +3,6 @@ class MatchesController < ApplicationController # GET /matches/1 def show - render json: Match.find(params[:id]), include: ['match_scores.points', 'match_scores.team'], status: status + render json: Match.find(params[:id]), include: ['match_scores.points', 'match_scores.team'] end end diff --git a/app/controllers/teams_controller.rb b/app/controllers/teams_controller.rb index b61d202..9ac727e 100644 --- a/app/controllers/teams_controller.rb +++ b/app/controllers/teams_controller.rb @@ -26,6 +26,6 @@ class TeamsController < ApplicationController end def team_params - deserialize_params only: %i[name] + params.require(:team).permit(:name) end end diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index b6375a6..0bb0334 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -48,6 +48,6 @@ class TournamentsController < ApplicationController end def tournament_params - deserialize_params only: %i[name description public teams] + params.require(:tournament).permit(:name, :description, :public, :teams) end end