<commit_before># Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/

module ApplicationModel::Assets

=begin

get all assets / related models for this user

  user = User.find(123)
  result = user.assets( assets_if_exists )

returns

  result = {
    :users => {
      123  => user_model_123,
      1234 => user_model_1234,
    }
  }

=end

  def assets (data)

    if !data[ self.class.to_app_model ]
      data[ self.class.to_app_model ] = {}<commit_msg>Improved api handling. No longer a empty hash is needed.<commit_after># Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/

module ApplicationModel::Assets

=begin

get all assets / related models for this user

  user = User.find(123)
  result = user.assets( assets_if_exists )

returns

  result = {
    :users => {
      123  => user_model_123,
      1234 => user_model_1234,
    }
  }

=end

  def assets (data = {})

    if !data[ self.class.to_app_model ]
      data[ self.class.to_app_model ] = {}
{'fraction_non_alphanumeric': 0.1145418326693227, 'fraction_numerical': 0.049800796812749, 'mean_word_length': 3.0524193548387095, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2350101', 'n_tokens_mistral': 386, 'n_tokens_neox': 335, 'n_words': 87}