allow reloading of models

This commit is contained in:
Dylan Knutson
2025-07-18 16:40:18 +00:00
parent 5cf9cfbc81
commit 26ad0e3ea3
2 changed files with 23 additions and 0 deletions

View File

@@ -722,4 +722,22 @@ RSpec.describe HasAuxTable do
expect(fork1.num_tongs).to eq(3)
end
end
it "can redefine constants" do
class TestModel < ActiveRecord::Base
include HasAuxTable
end
class TestModelSpecific < TestModel
aux_table :specific
end
Object.send(:remove_const, :TestModelSpecific)
expect {
class TestModelSpecific < TestModel
aux_table :specific
end
}.not_to raise_error
end
end