# Trunk and single table inheritance

**URL:** <https://www.ruby-forum.com/t/trunk-and-single-table-inheritance/134554>\
**Category:** Ferret\
**Created:** [April 11, 2008, 10:52pm UTC](https://www.ruby-forum.com/t/trunk-and-single-table-inheritance/134554 "2008-04-11T22:52:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [April 11, 2008, 10:52pm UTC](https://www.ruby-forum.com/t/trunk-and-single-table-inheritance/134554/1 "2008-04-11T22:52:52Z")

</div>

## My colleague Josh was having a hard time getting this email though either the web or email interfaces, so I’m forwarding it along.

Hi all,

I’m getting discrepancies between stable and trunk when doing a  
search involving single-table inheritance and I can’t locate the  
problem.

I’m running Rails 2.0.2 with the following (simplified) schema:

class Model \< ActiveRecord::Base  
acts\_as\_ferret  
end

class ModelSubClass \< Model  
end

Under AAF/tags/stable, Model.find\_by\_contents(’\*’) returns all Models  
and all ModelSubClasses. Under AAF/trunk, the same query only returns  
Models. Has AAF changed its STI model?

The API also indicates that find\_by\_contents no longer takes  
the :models param, and including it does not change the output in  
either case – is there a new way to search across multiple classes?  
If I could manually force the query to look at Model and all  
subclasses, I could live with the workaround.

Thanks,  
Josh

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [April 12, 2008, 9:55am UTC](https://www.ruby-forum.com/t/trunk-and-single-table-inheritance/134554/2 "2008-04-12T09:55:21Z")

</div>

Hi,

there has happened a lot in aaf trunk since the 0.4.3 was released, so  
this might well be a bug I introduced recently.

I’ll look into this. Could you please file a ticket on trac?

Cheers,  
Jens

On Fri, Apr 11, 2008 at 04:09:04PM -0400, John B. wrote:

> The API also indicates that find\_by\_contents no longer takes  
> the :models param, and including it does not change the output in  
> either case – is there a new way to search across multiple classes?  
> If I could manually force the query to look at Model and all  
> subclasses, I could live with the workaround.
> 
> Thanks,  
> Josh

> * * *
> 
> Ferret-talk mailing list  
> removed\_email\_address@domain.invalid  
> [http://rubyforge.org/mailman/listinfo/ferret-talk](http://rubyforge.org/mailman/listinfo/ferret-talk)

–  
Jens Krämer  
Finkenlust 14, 06449 Aschersleben, Germany  
VAT Id DE251962952  
[http://www.jkraemer.net/](http://www.jkraemer.net/) - Blog  
[http://www.omdb.org/](http://www.omdb.org/) - The new free film database
