You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: interventions_controller.rb
    path of file: ./repos/ekylibre/app/controllers/backend/products
    
    the code of the file until where you have to start completion: # == License
# Ekylibre - Simple agricultural ERP
# Copyright (C) 2014 Sebastien Gauvrit, Brice Texier
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
    
      def has_harvesting
        product = Product.find_by(id: params[:id])
        intervention_started_at = Time.parse(params[:intervention_started_at])

        if product.present?
          harvesting_count = ::Interventions::HarvestInProgressQuery
                               .call(Intervention, product, intervention_started_at)
                               .count

          render json: { has_harvesting: harvesting_count > 0 }
        else
          render json: { error: { message: "Cannot find product of id='#{params[:id]}'" } }, status: :not_found
        end