Sha256: 8dfc72858f6c8788b40bb9b763924d2c06d070885f11adf62ab0ee3551d69c89
Contents?: true
Size: 611 Bytes
Versions: 62
Compression:
Stored size: 611 Bytes
Contents
ActiveModel::Name.class_eval do # adds a default pluralization for english # useful to avoid to set a locale 'en' file and avoid # to pass around pluralize calls for 'en' defaults in hobo def human_with_en_pluralization_default(options={}) if I18n.locale.to_s.match(/^en/) unless options[:count] == 1 || options[:count].blank? default = ActiveSupport::Inflector.pluralize(@human) options.merge! :default => default end end human_without_en_pluralization_default(options) end alias_method_chain :human, :en_pluralization_default end
Version data entries
62 entries across 62 versions & 1 rubygems