From bf812074fd55e7dcfa426d6c9bfd4d8d68922194 Mon Sep 17 00:00:00 2001 From: Grant Hutchins & Peter Jaros Date: Fri, 8 Jul 2011 17:54:15 -0400 Subject: Let ActiveModel instances define partial paths. Deprecate ActiveModel::Name#partial_path. Now you should call #to_path directly on ActiveModel instances. --- activemodel/lib/active_model/naming.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activemodel/lib/active_model/naming.rb') diff --git a/activemodel/lib/active_model/naming.rb b/activemodel/lib/active_model/naming.rb index 4c1a82f413..26fa3062eb 100644 --- a/activemodel/lib/active_model/naming.rb +++ b/activemodel/lib/active_model/naming.rb @@ -1,12 +1,15 @@ require 'active_support/inflector' require 'active_support/core_ext/hash/except' require 'active_support/core_ext/module/introspection' +require 'active_support/core_ext/module/deprecation' module ActiveModel class Name < String attr_reader :singular, :plural, :element, :collection, :partial_path, :route_key, :param_key, :i18n_key alias_method :cache_key, :collection + deprecate :partial_path => "ActiveModel::Name#partial_path is deprecated. Call #to_path on model instances directly instead." + def initialize(klass, namespace = nil, name = nil) name ||= klass.name super(name) -- cgit v1.2.3