Displaying 1 result from an estimated 1 matches for "dbdict_en_typ".
Did you mean:
  dbdict_en_type
  
2006 Apr 17
0
polymorphic association with single model as target
...=> true
I use the ref_id as foreign key (as in all the examples) and ref_type as 
INTEGER with a number defining the dictionary I''d like to refer too.
Doing the "joins" myself as in the exemple below works well.
    @marks_en = DbDict.find(:all,
               :target => DBDICT_EN_TYPE,
               :joins => "as db inner join marks as ma on ma.ref_id = 
db.id",
               :conditions => "ma.ref_type = " + DBDICT_EN_TYPE.to_s)
Doing a call to something like:
    @mark = Mark.find(params[:id]).ref
Does not work.  I clearly understand that this w...