diff options
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/base_test.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index 9518e0aca8..f52253dd8b 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -13,7 +13,9 @@ require 'fixtures/keyboard' class Category < ActiveRecord::Base; end class Smarts < ActiveRecord::Base; end -class CreditCard < ActiveRecord::Base; end +class CreditCard < ActiveRecord::Base + class PinNumber < ActiveRecord::Base; end +end class MasterCreditCard < ActiveRecord::Base; end class Post < ActiveRecord::Base; end class Computer < ActiveRecord::Base; end @@ -372,16 +374,18 @@ class BasicsTest < Test::Unit::TestCase assert_equal "categories", Category.table_name assert_equal "smarts", Smarts.table_name assert_equal "credit_cards", CreditCard.table_name + assert_equal "credit_card_pin_numbers", CreditCard::PinNumber.table_name assert_equal "master_credit_cards", MasterCreditCard.table_name ActiveRecord::Base.pluralize_table_names = false - [Category, Smarts, CreditCard, MasterCreditCard].each{|c| c.reset_table_name} + [Category, Smarts, CreditCard, CreditCard::PinNumber, MasterCreditCard].each{|c| c.reset_table_name} assert_equal "category", Category.table_name assert_equal "smarts", Smarts.table_name assert_equal "credit_card", CreditCard.table_name + assert_equal "credit_card_pin_number", CreditCard::PinNumber.table_name assert_equal "master_credit_card", MasterCreditCard.table_name ActiveRecord::Base.pluralize_table_names = true - [Category, Smarts, CreditCard, MasterCreditCard].each{|c| c.reset_table_name} + [Category, Smarts, CreditCard, CreditCard::PinNumber, MasterCreditCard].each{|c| c.reset_table_name} ActiveRecord::Base.table_name_prefix = "test_" Category.reset_table_name @@ -410,7 +414,7 @@ class BasicsTest < Test::Unit::TestCase Category.reset_table_name assert_equal "category", Category.table_name ActiveRecord::Base.pluralize_table_names = true - [Category, Smarts, CreditCard, MasterCreditCard].each{|c| c.reset_table_name} + [Category, Smarts, CreditCard, CreditCard::PinNumber, MasterCreditCard].each{|c| c.reset_table_name} end def test_destroy_all |