Closed machisuke closed 2 years ago
ActiveRecord v5 and v6 uses ActiveSupport::Dependencies#constantize, ActiveSupport::Dependencies#saef_constantize which uses cached constantize results.
According to this, the above behavior is bug and fixed in ActiveRecord v7
If the tests run with ActiveRecord v5 and v6, clear the cache in the before hook of all test cases to avoid ActiveRecord edge case bug.
Pulled out of https://github.com/active-hash/active_hash/pull/255
@machisuke where are you seeing side effects of this bug? Are there particular tests that are having problems?
background
ActiveRecord v5 and v6 uses ActiveSupport::Dependencies#constantize, ActiveSupport::Dependencies#saef_constantize which uses cached constantize results.
According to this, the above behavior is bug and fixed in ActiveRecord v7
changes
If the tests run with ActiveRecord v5 and v6, clear the cache in the before hook of all test cases to avoid ActiveRecord edge case bug.
note
Pulled out of https://github.com/active-hash/active_hash/pull/255