From 10220d356dccb6ccdfe3d1a91531511d6f0a9cf8 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 25 Jan 2005 18:45:06 +0000 Subject: Fixed dependency reloading by switching to a remove_const approach where all Active Records, Active Record Observers, and Action Controllers are reloading by undefining their classes. This enables you to remove methods in all three types and see the change reflected immediately and it fixes #539. This also means that only those three types of classes will benefit from the const_missing and reloading approach. If you want other classes (like some in lib/) to reload, you must use require_dependency to do it. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@511 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/association_inheritance_reload.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 activerecord/test/association_inheritance_reload.rb (limited to 'activerecord/test/association_inheritance_reload.rb') diff --git a/activerecord/test/association_inheritance_reload.rb b/activerecord/test/association_inheritance_reload.rb new file mode 100644 index 0000000000..a3d5722841 --- /dev/null +++ b/activerecord/test/association_inheritance_reload.rb @@ -0,0 +1,14 @@ +require 'abstract_unit' +require 'fixtures/company' + +class AssociationInheritanceReloadTest < Test::Unit::TestCase + fixtures :companies + + def test_set_attributes + assert_equal ["errors.add_on_empty('name', \"can't be empty\")"], Firm.read_inheritable_attribute("validate"), "Second run" + # ActiveRecord::Base.reset_column_information_and_inheritable_attributes_for_all_subclasses + remove_subclass_of(ActiveRecord::Base) + load 'fixtures/company.rb' + assert_equal ["errors.add_on_empty('name', \"can't be empty\")"], Firm.read_inheritable_attribute("validate"), "Second run" + end +end \ No newline at end of file -- cgit v1.2.3