# Locating the source of ActiveRecord::Base.send

**URL:** <https://www.ruby-forum.com/t/locating-the-source-of-activerecord-base-send/86940>\
**Category:** Rails\
**Created:** [February 27, 2007, 12:04am UTC](https://www.ruby-forum.com/t/locating-the-source-of-activerecord-base-send/86940 "2007-02-27T00:04:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/898d66/32.png) [@eric](https://www.ruby-forum.com/u/eric)\
**Post date:** [February 27, 2007, 12:04am UTC](https://www.ruby-forum.com/t/locating-the-source-of-activerecord-base-send/86940/1 "2007-02-27T00:04:29Z")

</div>

I downloaded a plugin and was looking over the code when I came across  
ActiveRecord::Base.send. I noticed that several tutorials stated that  
you just call the method to mixin your new plugin class. Curious as to  
what the actual defintion of the “send” method was, I looked at the  
api and found no mention of it.

How does one usually go about searching for the source of the method?  
It’s not the first method I’ve come across where it wasn’t listed in  
the docs so ideally I would like to know what steps you go through to  
find the definition of something so the next time I can figure it out  
by myself.

Thanks,

Eric

---

<div class="post-metadata">

**Author:** ![eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/898d66/32.png) [@eric](https://www.ruby-forum.com/u/eric)\
**Post date:** [February 27, 2007, 12:10am UTC](https://www.ruby-forum.com/t/locating-the-source-of-activerecord-base-send/86940/2 "2007-02-27T00:10:30Z")

</div>

send is actually a method that is used to call private methods  
declared in a class. Ruby for Rails book has some good tips on how to  
go about figuring out whether Base is a class or module and how to  
track down the methods.

---

<div class="post-metadata">

**Author:** ![eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/898d66/32.png) [@eric](https://www.ruby-forum.com/u/eric)\
**Post date:** [February 27, 2007, 12:28am UTC](https://www.ruby-forum.com/t/locating-the-source-of-activerecord-base-send/86940/3 "2007-02-27T00:28:32Z")

</div>

Eric wrote:

> by myself.
> 
> Thanks,
> 
> Eric
> 
> >

It is a ruby thing. Check out  
[http://www.ruby-doc.org/core/classes/Object.html#M000292](http://www.ruby-doc.org/core/classes/Object.html#M000292)

Matt M.  
[blog.mattmargolis.net](http://blog.mattmargolis.net)

---

<div class="post-metadata">

**Author:** ![eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/898d66/32.png) [@eric](https://www.ruby-forum.com/u/eric)\
**Post date:** [February 27, 2007, 12:41am UTC](https://www.ruby-forum.com/t/locating-the-source-of-activerecord-base-send/86940/4 "2007-02-27T00:41:33Z")

</div>

> I downloaded a plugin and was looking over the code when I came across  
> ActiveRecord::Base.send. I noticed that several tutorials stated that  
> you just call the method to mixin your new plugin class. Curious as to  
> what the actual defintion of the “send” method was, I looked at the  
> api and found no mention of it.

don’t forget Rails is “just” a framework on top of Rails, but the  
programming language itself is Ruby. In this case, “send” is one of the  
methods Object (in Ruby). It’s one of the ways available for dynamically  
call a method on any object.

> How does one usually go about searching for the source of the method?

If you cannot find the method in the source of your class, then take a  
look at its mixins and parent classes.

If still not there, then it’s very likely that it is a method either of  
Object, Class or Module, in Ruby. Unfortunately, the source of these  
methods is in C, in case you want to take a look at their source. The  
good news is that the C code is pretty well structured and commented, so  
many times it’s readable enough.

regards,

javier ramirez

## –

Estamos de estreno… si necesitas llevar el control de tus gastos  
visita [http://www.gastosgem.com](http://www.gastosgem.com) !!Es gratis!!
