Permalink
Browse files

do not compute table names for abstract classes

  • Loading branch information...
1 parent 50db00d commit 933120cdfe461a442e615c638a43bc66cb86df99 @amatsuda amatsuda committed with tenderlove Aug 24, 2011
Showing with 6 additions and 0 deletions.
  1. +2 −0 activerecord/lib/active_record/base.rb
  2. +4 −0 activerecord/test/cases/base_test.rb
@@ -622,6 +622,8 @@ def quoted_table_name
# Computes the table name, (re)sets it internally, and returns it.
def reset_table_name #:nodoc:
+ return if abstract_class?
+
self.table_name = compute_table_name
end
@@ -1624,6 +1624,10 @@ def test_abstract_class
assert !LooseDescendant.abstract_class?
end
+ def test_abstract_class_table_name
+ assert_nil AbstractCompany.table_name
+ end
+
def test_base_class
assert_equal LoosePerson, LoosePerson.base_class
assert_equal LooseDescendant, LooseDescendant.base_class

0 comments on commit 933120c

Please sign in to comment.