diff options
Diffstat (limited to 'activerecord/test/cases/associations/join_model_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/join_model_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb index 49a1c117bc..086654f4ce 100644 --- a/activerecord/test/cases/associations/join_model_test.rb +++ b/activerecord/test/cases/associations/join_model_test.rb @@ -13,6 +13,8 @@ require 'models/vertex' require 'models/edge' require 'models/book' require 'models/citation' +require 'models/aircraft' +require 'models/engine' class AssociationsJoinModelTest < ActiveRecord::TestCase self.use_transactional_fixtures = false unless supports_savepoints? @@ -704,6 +706,15 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase assert_equal [9, 10, new_comment.id], authors(:david).sti_post_comments.map(&:id).sort end + def test_has_many_with_pluralize_table_names_false + engine = Engine.create(:car_id => 1) + Aircraft.pluralize_table_names = false + aircraft = Aircraft.create!(:name => "Airbus 380", :id => 1) + assert_equal aircraft.engines, [engine] + ensure + ActiveRecord::Base.pluralize_table_names = true + end + private # create dynamic Post models to allow different dependency options def find_post_with_dependency(post_id, association, association_name, dependency) |