public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Search Repo:
Improve ActiveRecord::Base#table_name unit tests for nested classes. 
Closes #10289. [scott_willson]


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9237 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
josh (author)
Mon Apr 07 12:44:37 -0700 2008
commit  4b68982f649c5b230b3e99954a71404c7cec03c7
tree    8aa1a83114fbf31af2856ebce5d99daacac8e540
parent  2cdc613598ae0774767c60e3c562fb6ca35971e0
...
31
32
33
 
 
 
 
 
34
...
31
32
33
34
35
36
37
38
39
0
@@ -31,5 +31,10 @@
0
     assert_kind_of MyApplication::Business::Firm, account.firm
0
   end
0
 
0
+ def test_table_name
0
+ assert_equal 'accounts', MyApplication::Billing::Account.table_name, 'table_name for ActiveRecord model in module'
0
+ assert_equal 'companies', MyApplication::Business::Client.table_name, 'table_name for ActiveRecord model subclass'
0
+ assert_equal 'company_contacts', MyApplication::Business::Client::Contact.table_name, 'table_name for ActiveRecord model enclosed by another ActiveRecord model'
0
+ end
0
 end
...
17
18
19
 
 
20
21
22
...
17
18
19
20
21
22
23
24
0
@@ -17,6 +17,8 @@
0
     class Client < Company
0
       belongs_to :firm, :foreign_key => "client_of"
0
       belongs_to :firm_with_other_name, :class_name => "Firm", :foreign_key => "client_of"
0
+
0
+ class Contact < ActiveRecord::Base; end
0
     end
0
 
0
     class Developer < ActiveRecord::Base

Comments

    No one has commented yet.