diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2011-05-20 01:53:13 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2011-05-20 01:53:13 -0500 |
commit | 23e94a67f8e922a9ccde7f8b2e6abc56a925d6bf (patch) | |
tree | dc3f5b7d5ac6980ab1ee8ad249d1116a54ad157d | |
parent | 6a3b3fba5a173dc8cd308c30426247e93e5fc97e (diff) | |
download | rails-23e94a67f8e922a9ccde7f8b2e6abc56a925d6bf.tar.gz rails-23e94a67f8e922a9ccde7f8b2e6abc56a925d6bf.tar.bz2 rails-23e94a67f8e922a9ccde7f8b2e6abc56a925d6bf.zip |
Refactoring test_has_many_with_pluralize_table_names_false test
-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 |