<%= raise Exception.new("asked for count of a string") if this.is_a?(String) Rails.logger.warn('The "prefix" attribute is deprecated: please, use a locale string') unless prefix.blank? c = collection_count # generated label will be pluralized label ||= case when this.is_a?(Class) this.model_name.human(:count=>c) when (attr = this.try.origin_attribute) (this_parent || this.origin).class.human_attribute_name(attr, :count=>c) when this.member_class this.member_class.model_name.human(:count => c) else this.first.class.model_name.human(:count => c) end label = label.downcase if lowercase Dryml.last_if = c > 0 if if_any if if_any && c == 0 "" else if summary.blank? # old behaviour main = label.blank? ? c : "#{c} #{label}" if prefix.in? %w(are is) prefix = c == 1 ? "is" : "are" end (prefix ? "#{prefix} #{main}" : main.to_s) else key = summary.kind_of?(String) ? summary : "default" default = c == 1 ? "There is 1 #{label}" : "There are #{c} #{label}" t "tags.count.#{key}", {:count=>c, :label=>label, :default=>default}.merge(attributes) end end %>