Including 2 different models in rails application for one table

I am having some integration issues. I have two models that need to be matched so that they can talk to the same table. Thus, one model has several attributes that are mapped to the corresponding columns in the table, as well as for another model.

I heard about aliasing, a method that you can use. Help would be appreciated. Thank you

+4
source share
1 answer

You create two models and define the same table_name

class ProjectComplete < ActiveRecord::Base set_table_name "projects" end class ProjectLittle < ActiveRecord::Base set_table_name "projects" end 
+6
source

All Articles