开发者

How do I know which mixins the Rails API uses?

When reading Ruby on Rails tutorials I often run across source code for classes that contain method calls that don't appear in the class documentation online. For example, when using ActiveRecord "save" is used. However, "save" does not appear in the docs fo开发者_如何学JAVAr ActiveRecord::Base. How do I determine that ActiveRecord::Base uses a mixin from ActiveRecord::Persistence? Generally, when looking at the documentation for a class, I like to be able to determine which methods I have available for use. It appears as though an important piece is missing.


UPDATE: Found them. The methods a class contains (mixins and normal) are located in the bottom-left box on the API documentation site. Initiallly, I thought that box contained all methods available in the framework, not just the ones available for ActiveRecord (100's). It never occurred to me that ActiveRecord, or any class, would be designed to be that large via all of the includes and extends.

As per the recommendation of the Tin Man, here is the link to the API's

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜