def set_target
        if (target_type = params[:target_type]).present?
          target_class = target_type.to_model_class
          @target = params[:target_id].present? ?
            target_class.find_by!(id: params[:target_id]) :
            target_class.find_by!(id: params["#{target_type.to_resource_name}_id"])
        else
          render plain: "400 Bad Request: Missing parameter", status: 400
        end
      end
def set_target
        if (target_type = params[:target_type]).present?
          target_class = target_type.to_model_class
          @target = params[:target_id].present? ?
            target_class.find_by!(id: params[:target_id]) :
            target_class.find_by!(id: params["#{target_type.to_resource_name}_id"])
        else
          render plain: "400 Bad Request: Missing parameter", status: 400
        end
      end
Sets @target instance variable from request parameters.
 @api protected
 @return [Object] Target instance (Returns HTTP 400 when request parameters are not enough)