Why is the all method defined in ActiveRecord::Base not listed in the documentation?
I know it is defined here because I ran Post.method(:all).source_location and got this output:
["/Users/space/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/base.rb",
440]
Because it’s defined by the
delegate“macro” and the documentation generator isn’t aware of that thedelegatecall has the side effect of defining theallmethod.Sidenote: YARD (Yay! A Ruby Documentation Tool) is programmable and could easily be extended to deduce this (if it doesn’t already).