I have been struggling for quite sometime with this.
Is there any way to configure the Model to store user defined value in
the inheritance_column instead of the default value (which is
class_name)
The problem I have is like this:
I have a User model and there are different models which inherit from
this like Admin, Premium, Professional, etc.
Each of these inherited models are identified by a field named role_id
in the users table and it contains integer values for e.g. 1 for
Admin, 2 for Premium, 3 for Professional and so on.
I want to set this role_id field as the inheritance_column, which can
be easily done by specifying :inheritance_column => "role_id" in the
User Model. But how do I configure Rails to store these numerical
values in the role_id field, instead of the Class name?
I will really appreciate if anybody can help me out with this.