开发者

How do I know which modules are associated with ActiveRecord::Base?

开发者 https://www.devze.com 2023-03-19 23:56 出处:网络
I\'m having some difficulty locating where methods invoked on ActiveRecord instanc开发者_JAVA百科es are defined.Usually they come from some mixed-in module, but I can\'t even find documentation indica

I'm having some difficulty locating where methods invoked on ActiveRecord instanc开发者_JAVA百科es are defined. Usually they come from some mixed-in module, but I can't even find documentation indicating which modules are mixed in. Is there documentation anywhere that lists the modules that are mixed into ActiveRecord? Or do I have to open up base.rb to find out?

This is actually just a specific instance of dealing with Rails in general- if I want to find where a method is defined, how to I go about looking for it? Do most people go straight to the code?


The Rails source code can be convoluted for sure. When I get lost I start by going to the Rails API and just do a Ctrl-F and look for the method name. What is the specific method you are asking about?

0

精彩评论

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