From fe22556f93c2e07a0f170a273915823572409624 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Sun, 3 May 2015 18:10:34 +0000 Subject: [PATCH] Refactor API JSON filter --- app/controllers/api/application_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/application_controller.rb b/app/controllers/api/application_controller.rb index 0bea5bc..eeb7509 100644 --- a/app/controllers/api/application_controller.rb +++ b/app/controllers/api/application_controller.rb @@ -37,9 +37,8 @@ module API end def json_filter! - if request.format != :json - head :not_acceptable, content_type: 'application/json' - end + return if request.format.json? + head :not_acceptable, content_type: 'application/json' end end end