# Extending ActiveRecord Extensions

**URL:** <https://www.ruby-forum.com/t/extending-activerecord-extensions/88952>\
**Category:** Rails\
**Created:** [March 15, 2007, 9:39pm UTC](https://www.ruby-forum.com/t/extending-activerecord-extensions/88952 "2007-03-15T21:39:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmckible](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c4cdca/32.png) [@jmckible](https://www.ruby-forum.com/u/jmckible)\
**Post date:** [March 15, 2007, 9:39pm UTC](https://www.ruby-forum.com/t/extending-activerecord-extensions/88952/1 "2007-03-15T21:39:42Z")

</div>

Let’s say I’ve got a table of people. Each person is either male or  
female and single or not single. I can get methods like:

group.people.male  
group.people.female  
group.people.single

By using extensions a la:

class Group \< ActiveRecord::Base  
has\_many :people do  
def single  
find :all, :conditions=\>{:single=\>true}  
end  
end

But what if I wanted methods like:

group.people.female.single

Is there a way to extend the extensions at all? It seems like this  
functionality would be very helpful to encapsulate everything so you  
don’t end up with methods like

group.people.female\_and\_single  
group.people.male\_and\_not\_single

Thoughts?
