From: george.ogata@... Date: 2016-06-19T00:34:47+00:00 Subject: [ruby-core:76071] [Ruby trunk Feature#3511] rb_path_to_class should call custom const_defined? methods Issue #3511 has been updated by George Ogata. Hiroshi Nakamura wrote: > Aaron, is this hook extension still needed for your usecase? (assuming Rails?) > > Not bad but it would affect performance... Would this idea still be considered? I find this issue comes up fairly frequently in Rails apps when an object is serialized and deserialized in a separate process. I think the performance problem could be addressed by keeping the rb_const_defined call, and then only if that fails try the rb_funcall. WDYT? ---------------------------------------- Feature #3511: rb_path_to_class should call custom const_defined? methods https://bugs.ruby-lang.org/issues/3511#change-59271 * Author: Aaron Patterson * Status: Feedback * Priority: Normal * Assignee: ---------------------------------------- =begin It would be nice if rb_path_to_class called custom const_defined? methods. This would give marshaled objects a chance to locate and define classes when they are being unmarshalled. I've attached a patch with a test that demonstrates the desired functionality and a (probably naive) implementation. =end ---Files-------------------------------- rb_path_to_class.patch (1.67 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: