lundi 3 avril 2017

Ruby: inheritance or something else

I've a quick and quite basic question to ask. I would like to create a new model which has a parameter that can be one of several model types. Ex: the param 'targeted_object' can be either an instance of Model A or an instance of Model B. For the moment I don't think I need a similar behavior for Model A and Model B, so my first guess is to create a Master model for Model A and Model B named TargetableObject: create inheritance. But is it the best way to do this or I need to make something else regarding that I presume for now no related behavior for Master object children?

Thanks

Aucun commentaire:

Enregistrer un commentaire