File: name.rb

package info (click to toggle)
ruby-gettext-i18n-rails 1.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 148 kB
  • sloc: ruby: 515; makefile: 6
file content (13 lines) | stat: -rw-r--r-- 259 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
module ActiveModel
  Name.class_eval do
    def human(options={})
      human_name = @klass.humanize_class_name

      if count = options[:count]
        n_(human_name, human_name.pluralize, count)
      else
        _(human_name)
      end
    end
  end
end