deepfryed, I'm quite sure that dm looks for matching model *keys* when you give :child_key and :parent_key options to relationship definitions. So if you want :child_key => [:code, :country] you need to make sure the both :code and :country are marked with :key => true. Also, :id, Serial, :key => true is not necessary, :id, Serial is enough. Serial properties are keys by default.
HTH snusnu On Sun, Sep 6, 2009 at 15:21, deepfryed<[email protected]> wrote: > > http://pastie.org/607656 > > the code generates the following SQL > > SELECT "id", "name", "type", "code", "country" FROM "books" WHERE > "type" = 'fiction' AND ("code" = '1' AND "country" = 'au') OR ("code" > = '2' AND "country" = 'au') ORDER BY "id" > > which is incorrect. > > am I doing something incorrectly ? > > i'm using dm-core/next > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---
