# Adding Modules to ActiveRecord

**URL:** <https://www.ruby-forum.com/t/adding-modules-to-activerecord/184150>\
**Category:** Rails\
**Created:** [February 25, 2010, 6:42pm UTC](https://www.ruby-forum.com/t/adding-modules-to-activerecord/184150 "2010-02-25T18:42:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 25, 2010, 6:42pm UTC](https://www.ruby-forum.com/t/adding-modules-to-activerecord/184150/1 "2010-02-25T18:42:29Z")

</div>

Hi,

I need to add some methods to all my models. These methods are likely  
to be used in pretty much every Rails project I work on for the  
foreseeable future, so am guessing that it would be best to add them  
to ActiveRecord.

The methods are all in their own modules, which include additional  
modules, and are all packaged inside a single Manager module.

I have had a look into ActiveRecord, but don’t know enough about  
ActiveRecord yet to dive in and change or add to it.

Could someone point me in the right direction?

Example

```auto
manager.rb
  module Manager

    # Constants Defined

    module PackageSearchResult
      include Packager
      include Result
      include Searcher

      def method1
        ...
      end
    end
  end
```

How would I put Manager into ActiveRecord so that all my models get  
method1 by default?

Thanks

Paul
