In DataMapper, I have tables like this:
Foo
===
id Integer
other_columns Whatever
Fuzz
===
id Integer
other_columns Whatever
For associations:
class Fuzz
has 1, :foo, :child_key => :id
end
When I call: Fuzz.first.foo
DataMapper generates SQL like this: select raw_sql_.* from(SELECT "ID", "OTHER_COLUMNS", "ID" FROM "FOO" WHERE ... ORDER BY "ID")
Because of the "ORDER BY" clause, Oracle comes back saying: ambiguous column naming in select list
How do I avoid this situation? This is a legacy database system, so I have no option to change the schema.