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

Different options for STI models #55

Closed
stoicskyline opened this issue May 10, 2013 · 1 comment
Closed

Different options for STI models #55

stoicskyline opened this issue May 10, 2013 · 1 comment

Comments

@stoicskyline
Copy link

Quick question: is it possible to have different acts_as_tree options for subclasses of a STI model? Specifically, can we do this:

def Person
  acts_as_tree
end

def Person::Teacher < Person
  acts_as_tree :order => 'age'
end

def Person::Student < Person
  acts_as_tree :order => 'name'
end

In this example, each teacher, ordered by age, has children ordered by name.

@stoicskyline
Copy link
Author

Played with this a bit, looks like this works fine!

self_and_descendants_preordered doesn't seem to work very well in Rails console but I think that's some other problem.

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

1 participant