<commit_before>class Backend::Cells::LastInterventionsCellsController < Backend::CellsController

  def show
    @intervention = Intervention.last
    production = Production.find(@intervention.production_id)
    if target = @intervention.casts.of_role(:target).first.actor_id
      container = Product.find(target)
      # if container.is_a?(CultivableLandParcel)
      #   @container = container.class.find(container.id)
      if container.is_a?(Plant)
        @container = CultivableLandParcel.find(container.current_place_id)
      else
        @container = container
      end
    end
  end

end<commit_msg>fix bug on last interventions cells<commit_after>class Backend::Cells::LastInterventionsCellsController < Backend::CellsController

  def show
    @intervention = Intervention.last
    production = Production.find(@intervention.production_id)
    target = @intervention.casts.of_role(:target) || @intervention.casts.of_role(:input)
    puts target
    if target.first
      actor = target.first.actor
      if actor
        container = Product.find(actor.id)
        # if container.is_a?(CultivableLandParcel)
        #   @container = container.class.find(container.id)
        if container.is_a?(Plant)
          @container = CultivableLandParcel.find(container.current_place_id)
        elsif container.is_a?(Animal)
          @container = BuildingDivision.find(container.current_place_id)
        else
          @container = container
        end
      end
    end
  end

end
{'fraction_non_alphanumeric': 0.09060402684563758, 'fraction_numerical': 0.0, 'mean_word_length': 3.2968299711815563, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7488178', 'n_tokens_mistral': 439, 'n_tokens_neox': 418, 'n_words': 75}