Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I make this work with MTI? #206

Open
birarda opened this issue Sep 5, 2014 · 2 comments
Open

Can I make this work with MTI? #206

birarda opened this issue Sep 5, 2014 · 2 comments

Comments

@birarda
Copy link

birarda commented Sep 5, 2014

I have a superclass model Region and a subclass model Domain - in the database this is implemented with multi-table inheritance using the 'active_record-acts_as' gem.

Is there a way to have the ancestry methods return me items of the two different classes? Currently I can get all items back as regions and have to promote the objects that are actually domains - this is a database hit I'd prefer to wrap into the original call.

@ethagnawl
Copy link

@birarda Did you ever figure out a workable solution using Ancestry?

@kbrock
Copy link
Collaborator

kbrock commented Sep 26, 2023

if you have implemented this as an STI, then this will work.
If you want ancestry to return from 2 different tables, that isn't available.

I too would like to hear about your solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants