Patrik, You were hitting a current limitiation in rails3_datamapper! Check out the latest code, I just committed an intermediate fix to your problem (natural keys should work now, composite keys still not). This was buried in my code for some time already (thx to Andy Ferra), but I had forgotten to push it.
checkout http://github.com/dkubb/rails3_datamapper for latest codes. Note though that the latest code at dkubb/rails3_datamapper isn't yet compatible with rails master. If you need rails master, use my fork at http://github.com/snusnu/rails3_datamapper I should warn you though, there are quite some internal changes in my fork, so if you have some time still, I'd recommend keep on using official dkubb/rails3_datamapper for some more time. Eventually, the stuff from my fork will be merged. cheers snusnu On Wed, Feb 17, 2010 at 13:32, Patrik Sundberg <[email protected]> wrote: > Hi, > > I have a few models not using a Serial id as primary key, instead > using a unique string related to the domain of the objects. > > When using them with rails3 (using rails3_datamapper) I run into > problems with things like content_tag_for who seem to assume that all > objects have an id property. > > I wanted to ask if anyone else has come across this before and if they > have any tips on good ways to deal with it? > > I am thinking that I could add something like this to keep rails > happy: > property :id, Serial, :key => false > > Haven't tried it yet, thought I'd check if there were any good > techniques I could reuse before getting into it. > > Thanks. > > -- > 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. > > -- 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.
