stefankroes / ancestry

Organise ActiveRecord model into a tree structure
MIT License
3.71k stars 456 forks source link

Add ability to set custom method names #148

Open raphqu opened 10 years ago

raphqu commented 10 years ago

Suppose that an application has a model with path attribute. When adding ancestry gem to the application, path attribute is overridden by Ancestry#path instance method. It might be useful if it were possible to set custom names for ancestry's methods, like it is in case of Authlogic#login_field.

kbrock commented 4 months ago

I would love to introduce a prefix method attribute.

To get there we'd need to introduce helper methods for all functions and then call those helpers from our added methods. We'd also need to define the methods like active record does instead of getting them through a mixed in module. This is quite a bit of change.

Is this path method part of ancestry or a different entry?