From 6b0e834a194d112585f41deba0a40780d68e38c6 Mon Sep 17 00:00:00 2001 From: Amiel Martin Date: Fri, 20 Jun 2014 15:49:27 -0700 Subject: Use #model_name on instances instead of classes This allows rails code to be more confdent when asking for a model name, instead of having to ask for the class. Rails core discussion here: https://groups.google.com/forum/#!topic/rubyonrails-core/ThSaXw9y1F8 --- actionview/test/activerecord/polymorphic_routes_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionview/test') diff --git a/actionview/test/activerecord/polymorphic_routes_test.rb b/actionview/test/activerecord/polymorphic_routes_test.rb index fef27ef492..b03fe66e23 100644 --- a/actionview/test/activerecord/polymorphic_routes_test.rb +++ b/actionview/test/activerecord/polymorphic_routes_test.rb @@ -34,8 +34,8 @@ class ModelDelegator < ActiveRecord::Base end class ModelDelegate - def self.model_name - ActiveModel::Name.new(self) + def model_name + ActiveModel::Name.new(self.class) end def to_param -- cgit v1.2.3