<commit_before>require 'lims-core/actions/action'
require 'lims-laboratory-app/labels/labellable'
require 'lims-laboratory-app/labels/labellable/create_labellable_shared'

module Lims::LaboratoryApp
  module Labels
    class Labellable
      class BulkCreateLabellable
        include Lims::Core::Actions::Action
        include CreateLabellableShared

        attribute :labellables, Array, :required => true, :writer => :private

        def _call_in_session(session)
          result = []
          labellables.each do |parameters|
            result << _create(parameters["name"], parameters["type"], parameters["labels"], session)
          end

          {:labellables => result.map { |e| e[:labellable] }}
        end
      end
    end
  end
end<commit_msg>Refactor BulkCreateLabellable using BulkAction.<commit_after>require 'lims-core/actions/bulk_action'
require 'lims-laboratory-app/labels/labellable/create_labellable'

module Lims::LaboratoryApp
  module Labels
    class Labellable
      class BulkCreateLabellable
        include Lims::Core::Actions::BulkAction
        initialize_class(:labellable, :labellables, CreateLabellable)
        def call(*args, &block)
          debugger
          super(*args, &block)
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0946372239747634, 'fraction_numerical': 0.0, 'mean_word_length': 3.174342105263158, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '5107680', 'n_tokens_mistral': 386, 'n_tokens_neox': 375, 'n_words': 76}