ThalesMiguel
ThalesMiguel

Reputation: 194

Ruby on Rails Generalization

I am trying to make an Generalization of some classes on my application. I have an "Employee" class that has "number", "name" and "salary" as attributes. I have the "Worker" class and the "Salesman" class that are both Employees and, therefore have all the "Employee" attributes. For example, when creating a new "Worker", I have to put data on my "Employee" class and on my "Worker" class... How do I make this generalization on RoR?

(http://support.objecteering.com/objecteering6.1/help/us/sql_designer/sql_images/fig13.gif)

Upvotes: 0

Views: 480

Answers (1)

Jacob Mattison
Jacob Mattison

Reputation: 51052

I'm not at all sure what you're asking, but I suspect the answer may be single table inheritance.

Upvotes: 2

Related Questions