From bfb9b7165ef4cb18835f65be600778bd8b1d6d11 Mon Sep 17 00:00:00 2001 From: kennyj Date: Wed, 4 Apr 2012 01:21:35 +0900 Subject: Get a properly aliased_table_name, when we use a polymorphic association. --- activerecord/lib/active_record/associations/association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb index fb0ca15c23..3c41a303d3 100644 --- a/activerecord/lib/active_record/associations/association.rb +++ b/activerecord/lib/active_record/associations/association.rb @@ -39,7 +39,7 @@ module ActiveRecord # post.comments.aliased_table_name # => "comments" # def aliased_table_name - reflection.klass.table_name + klass.table_name end # Resets the \loaded flag to +false+ and sets the \target to +nil+. -- cgit v1.2.3