Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multiple inheritance for a model

I want to create a multiple inheritance for a model.

in order to do that, I tried something like:

class User < ActiveRecord::Base, Devise::SessionsController

what is the way to do that correctly? I think my Syntax is not correct.

like image 608
Alon Shmiel Avatar asked Nov 01 '25 17:11

Alon Shmiel


1 Answers

Ruby doesn't support multiple inheritance. To share functionality between models, you want to use mixins. Check out this article, particularly the section on mixins.

like image 152
Scott S Avatar answered Nov 03 '25 07:11

Scott S