Model Class Table

In a model class, I’d like to include a class method to fetch a client_readable view.

I can easily hard code that into each model class but the only difference between those methods is the table name.

Is there some way I can derive the relevant table dynamically? Some attribute on the model class, perhaps?

Currently I don’t think there’s an obvious way to access the table it came from.

The best I can think of is to add your own name class attribute and add a mixin class.

2 Likes