# ActiveRecord::Base in environment.rb

**URL:** <https://www.ruby-forum.com/t/activerecord-base-in-environment-rb/157784>\
**Category:** Rails\
**Created:** [January 15, 2009, 10:04am UTC](https://www.ruby-forum.com/t/activerecord-base-in-environment-rb/157784 "2009-01-15T10:04:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [January 15, 2009, 10:04am UTC](https://www.ruby-forum.com/t/activerecord-base-in-environment-rb/157784/1 "2009-01-15T10:04:12Z")

</div>

have the following code in environment.rb

class ActiveRecord::Base  
extend Searchable  
end

```
in the lib folder there is searchable.rb and inside that there is

```

module Searchable

```
    My question is why do we define such a class in environment.rb

```

What is the actual purpose of this

Thanks in advance  
Sijo

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [January 15, 2009, 10:28am UTC](https://www.ruby-forum.com/t/activerecord-base-in-environment-rb/157784/2 "2009-01-15T10:28:08Z")

</div>

obviously you want to mix in the module Searchable into your  
ActiveRecord::Base. by using extend the methods inside the Searchable-  
module become class methods (with “include” they would become instance  
methods).

> My question is why do we define such a class in environment.rb  
> What is the actual purpose of this  
> since i don’t know your code, i can’t really tell you, what you are  
> doing (or trying to do).  
> besides: shouldn’t you know that yourself?
