allow reloading of models
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user