From 58cdbb5223d5fdda013ea33737d0ee0e8472d894 Mon Sep 17 00:00:00 2001 From: valentin Date: Tue, 26 May 2009 16:17:15 +0300 Subject: [PATCH] Added a unit test for updating all records in a table with inheritance. --- activerecord/test/cases/inheritance_test.rb | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/activerecord/test/cases/inheritance_test.rb b/activerecord/test/cases/inheritance_test.rb index 3f59eb9..f8075b8 100644 --- a/activerecord/test/cases/inheritance_test.rb +++ b/activerecord/test/cases/inheritance_test.rb @@ -157,6 +157,16 @@ class InheritanceTest < ActiveRecord::TestCase test_destroy_all_within_inheritance switch_to_default_inheritance_column end + + def test_update_all_company_records + Company.all.each do |company| + company.update_attributes :dummy_account => nil + end + + Company.all.each do |company| + assert company.dummy_account.nil?, "There is a company record with a set dummy account!" + end + end def test_find_first_within_inheritance assert_kind_of Firm, Company.find(:first, :conditions => "name = '37signals'") -- 1.6.1.3