<commit_before>module Trailblazer::Operation::Responder
  # TODO: test me.
  def self.included(base)
    base.extend ClassMethods
  end

  module ClassMethods
    def model_name
      ::ActiveModel::Name.new(self, nil, model_class.to_s) # FIXME: dependency to CRUD.
    end
  end

  def to_param
    @model.to_param
  end

  def errors
    return [] if @valid
    [1]
  end

  def to_json(*)
    self.class.representer_class.new(model).to_json
  end
end<commit_msg>Return the right ActiveModel::Name on operation<commit_after>module Trailblazer::Operation::Responder
  # TODO: test me.
  def self.included(base)
    base.extend ClassMethods
  end

  module ClassMethods
    def model_name
      ::ActiveModel::Name.new(self.parent, nil, model_class.to_s) # FIXME: dependency to CRUD.
    end
  end

  def to_param
    @model.to_param
  end

  def errors
    return [] if @valid
    [1]
  end

  def to_json(*)
    self.class.representer_class.new(model).to_json
  end
end
{'fraction_non_alphanumeric': 0.09165808444902163, 'fraction_numerical': 0.0020597322348094747, 'mean_word_length': 3.207792207792208, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3090400', 'n_tokens_mistral': 343, 'n_tokens_neox': 328, 'n_words': 82}