I have a table Foo
that has a polymorphic belongs_to association called bar
. The foos
table has the standard bar_id
column. However, instead of a string-based bar_type
column, I have an integer bar_type_id
column. This column references the id
column in the table bar_types
. bar_types.name
holds the name of the class that represents the class of the particular bar
instance.
Does Rails (ideally >=2.3.10) allow for this type of polymorphic association?
See Question&Answers more detail:os