From cbfb8f35c1c8bcaf8a58cab030c61dd76916418f Mon Sep 17 00:00:00 2001 From: Jonathan Kolyer Date: Fri, 24 Feb 2017 15:32:02 -0800 Subject: [PATCH] VRFS-3936 using Recording.create_immediately --- web/app/controllers/api_recordings_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/app/controllers/api_recordings_controller.rb b/web/app/controllers/api_recordings_controller.rb index c6c9406a0..507369945 100644 --- a/web/app/controllers/api_recordings_controller.rb +++ b/web/app/controllers/api_recordings_controller.rb @@ -15,11 +15,11 @@ class ApiRecordingsController < ApiController def create if request.headers['Jamk-Mobile-Env'] - result = Recording.new - result.owner = current_user - result.save - render :json => result, :status => 200 - return + result = Recording.create_immediately(current_user, params) + unless result.errors.any? + render :json => result, :status => 200 + return + end end response.status = :unprocessable_entity render :nothing