Ticket #10289: table_name_more_explicit_tests.diff
| File table_name_more_explicit_tests.diff, 1.2 kB (added by scott_willson, 1 year ago) |
|---|
-
test/fixtures/company_in_module.rb
old new 17 17 class Client < Company 18 18 belongs_to :firm, :foreign_key => "client_of" 19 19 belongs_to :firm_with_other_name, :class_name => "Firm", :foreign_key => "client_of" 20 21 class Contact < ActiveRecord::Base; end 20 22 end 21 23 22 24 class Developer < ActiveRecord::Base -
test/modules_test.rb
old new 31 31 assert_kind_of MyApplication::Business::Firm, account.firm 32 32 end 33 33 34 def test_table_name 35 assert_equal 'accounts', MyApplication::Billing::Account.table_name, 'table_name for ActiveRecord model in module' 36 assert_equal 'companies', MyApplication::Business::Client.table_name, 'table_name for ActiveRecord model subclass' 37 assert_equal 'company_contacts', MyApplication::Business::Client::Contact.table_name, 'table_name for ActiveRecord model enclosed by another ActiveRecord model' 38 end 39 34 40 end