diff options
-rw-r--r-- | activerecord/test/cases/associations/join_model_test.rb | 5 | ||||
-rw-r--r-- | activerecord/test/models/aircraft.rb | 1 |
2 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb index 8e23ab78be..b59ce4efeb 100644 --- a/activerecord/test/cases/associations/join_model_test.rb +++ b/activerecord/test/cases/associations/join_model_test.rb @@ -708,12 +708,9 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase end def test_has_many_with_pluralize_table_names_false - engine = Engine.create(:car_id => 1) - Aircraft.pluralize_table_names = false + engine = Engine.create!(:car_id => 1) aircraft = Aircraft.create!(:name => "Airbus 380", :id => 1) assert_equal aircraft.engines, [engine] - ensure - ActiveRecord::Base.pluralize_table_names = true end private diff --git a/activerecord/test/models/aircraft.rb b/activerecord/test/models/aircraft.rb index 0c47aab539..1f35ef45da 100644 --- a/activerecord/test/models/aircraft.rb +++ b/activerecord/test/models/aircraft.rb @@ -1,3 +1,4 @@ class Aircraft < ActiveRecord::Base + self.pluralize_table_names = false has_many :engines, :foreign_key => "car_id" end |