Displaying 1 result from an estimated 1 matches for "prefix_classname_suffix_id".
2006 Jan 06
0
bug rails activerecord association join
...in ActiveRecord association SQL INNER JOIN codes. in
has_many, has_one, habtm and belongs_to queries the foreign key is
determined from the table name of reflection and self. but that''s
worng because if you use a global prefix 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 nam...