爲什麼ActiveRecord::Base
中定義的all
方法未在documentation中列出?爲什麼在文檔中未列出ActiveRecord :: Base中定義的所有方法?
我知道它在這裏被定義,因爲我跑Post.method(:all).source_location
和得到這個輸出:因爲它是由delegate
「宏觀」和文檔生成定義
["/Users/space/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/base.rb",
440]
有趣的是,'all'方法在['default_scope'](http://api.rubyonrails.org/classes/ActiveRecord/Base.html#method-c- default_scope)方法描述中提及。 – sarnold