search for: classname_id

Displaying 1 result from an estimated 1 matches for "classname_id".

2006 Jan 06
0
bug rails activerecord association join
...efix or suffix for your tables the foreign keys will be in format of PREFIX_CLASSNAME_SUFFIX_id which is wrong, because it breaks the advantage of changing the prefix and giving it a go without chanigng any field names.. on the other hand the associations lik @blog.comments work just normal (using CLASSNAME_id). I fixed the problem by changing the determination of foreign key from table name to class name as following. I removed table_name references and replaced them with to_s''s to get class names.. I thought of using class_name method but it gives the parent class''s name in STI (I d...