The guy who is designing our database seems to have specified some
keys that are strings as well as some composite keys which are part
integer and part string.
I guess I could support that in rails by using find_by_sql() with no
problem if I had to ?
I will mention to him that it may be extra work etc.
The guy who is designing our database seems to have specified some
keys that are strings as well as some composite keys which are part
integer and part string.
I guess I could support that in rails by using find_by_sql() with no
problem if I had to ?
You could do even better. There’s a Rails plugin (don’t remember the
name, but a Web search should find it) that makes Rails work
transparently with composite keys.
In any case, find_by_sql will probably not be necessary, since you can
do find_by_key_field_1_and_key_field_2 or use :conditions.
I will mention to him that it may be extra work etc.
Tell him that Rails works better with a surrogate key…
I’ve referred people to it in the past, but I’ve never used it myself.
I’d love to hear that CPK works without a hitch with all the Rails
versions and plugins you care to throw at it, however, I fear that this
is not the case.
The changes CPK needs to make all over Rails are rather intrusive and
have to be adapted to the evolving code base. I’d expect a lot of code
out there, plugins specifically, to tacitly assume that ids are plain
numbers or can converted to numbers.
I’ve referred people to it in the past, but I’ve never used it myself.
I’d love to hear that CPK works without a hitch with all the Rails
versions and plugins you care to throw at it, however, I fear that this
is not the case.
It was the case for me, but it’s been quite a while since I actually
used it. I was very impressed by how effortless and transparent the
whole thing was.