I have two tables:
A pk - fk (referencesc TABLE 2)
I don’t use incremental field (id). I’d like don’t use find_by_sql.
How can I define both models to use correctly find method (with
include)? With only one column primary key I haven’t problems.
I thought two solutions, but I don’t like these very much (especially
- modify TABLE 1 (add field id as primary key and define A,B,C,D as
unique) and TABLE 2 (column A reference to field id of TABLE 1)
- I use DB web interface only read mode (users cannot write and
update) and then I can pretend (in model) that TABLE 1 primary key
were only column A
Can you help me?
Thank you very much