<commit_before>module Merb
  module Locomotive
    module AdministrationDashboardHelper

      # returns a humanized count string for an ActiveRecord model object
      # like "2 beers", "1 user" or "no life"
      def count_objects(type)
        counter = (type.count == 0 ? "no" : type.count.to_s)
        return (counter + " " + type.name) # FIXME: reinstate inflections .inflected
      end

    end
  end
end
<commit_msg>Fix inflection of model names on administration dashboard page<commit_after>module Merb
  module Locomotive
    module AdministrationDashboardHelper

      # returns a humanized count string for a DataObjects model object
      # like "2 beers", "1 user" or "no life"
      def count_objects(type)
        count = type.count
        counter = (count == 0 ? "no" : count.to_s)
        type_name = Extlib::Inflection.demodulize(type.name)
        return (counter + " " + (count < 1 || count > 1 ? type_name.pluralize : type_name))
      end

    end
  end
end

{'fraction_non_alphanumeric': 0.08536585365853659, 'fraction_numerical': 0.008130081300813009, 'mean_word_length': 2.7884615384615383, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2358857', 'n_tokens_mistral': 298, 'n_tokens_neox': 289, 'n_words': 97}