I have this code reek complains for DuplicateMethodCall (calls format.json twice)
if object_error.blank?
format.json { render json: order }
else
format.json { render json: object_error, status: :unprocessable_entity }
end
What is the best way to do it in rails? or is this false positive?