From what I understand, the super keyword calls a method with the same name as the current method in the superclass of the current class. There is a call to super in the autoload method autoload . I would like to know in which superclass I will find a method with the same name or what the super call does here
module ActiveSupport module Autoload ... def autoload(const_name, path = @@at_path) full = [self.name, @@under_path, const_name.to_s, path].compact.join("::") location = path || Inflector.underscore(full) if @@eager_autoload @@autoloads[const_name] = location end super const_name, location end .... end end module ActiveRecord extend ActiveSupport::Autoload ... autoload :TestCase autoload :TestFixtures, 'active_record/fixtures' end
This code is from the lead rail branch. Thank you very much.
ruby ruby-on-rails activerecord
user290870 Apr 08 2018-12-10T00: 00Z
source share