In the Rails application I am working in, I have code similar to the following:
When I run it locally, it does as expected, and I get non-zero as the return value. But I get nil in my test environment.
In the test environment, it is shown that A is among the ancestors of ( B.ancestors ) letter ( B.new ), but cannot be registered as a subclass with the case equality operator or is_a?(A) .
A === B.new #=> false in test environment, true locally B.new.is_a?(A) #=> false in test environment, true locally
This seems like a Rails startup problem, but I'm not sure why these methods will fail if the parent class is included in the ancestors in both environments. What's happening?
steel source share