Given the following class

class Post
   include DataMapper::Resource

   property :id, Serial, :field => 'post_id', :key => true
   property :thread_id, Integer
   property :username, String
   property :post_date, Integer
   property :message, Text

end

 
executing 'Post.get(1)' produces the following sql

SELECT `post_id`, `id`, `username`, `date`, `id`, `id` FROM `xf_post` WHERE 
`post_id` = 1 LIMIT 1


I've also tried changing the :id property name to all forms of insanity, 
but DataMapper keeps tacking the `id` column in the queries.
Is there a configuration somewhere to turn off assuming an id column? I'm 
mapping over a legacy database. 
 

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/datamapper/-/456dN_dlh9wJ.
To post to this group, send email to datamapper@googlegroups.com.
To unsubscribe from this group, send email to 
datamapper+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to