Acts_as_encapsulating / acts_as_inherit



The rails ORM is great…
But there is no support for enheritance except for the singletable

So we’ve come up with the idea:
Create a piece of code that allows the programmer to encapsulate /
objects in a easy way.

One example of it’s practical use.

Imagine a system where you have to store clients, employees and
They are all real persons.
It would be a waste to define attributes as name in three different
The nice way would be to create a Person model. It has the attributes
belong to a person.
Than client, employee and partner models encapsulate that person model.
Doing that, the models will inherit all attributes and methods in by

So how far are we?
We’ve managed to have it working, for the biggest part.
But it’s messy:

  • some hardcoding in the model is still required
  • mass asignment for update or new instance of models is broken
  • and some more advanced features are still waiting.

So who do we need?
Somebody who has experience in modifieing key methods in ActiveRecord
And ofcource any feedback or help is welcome.

The project is located @
(for some reason they renamed it to act_as_enherit)
we have a demo app available so you can see what we are aiming for

So check it out!