On Sun, 18 Apr 2010 10:20:19 -0400
Robert Boyer <[email protected]> wrote:

> Okay - this is really strange - the behavior is inconsistent: Last night 
> every table was acting the same now 3 tables I had seem to work and one does 
> not with NO changes. Here is a standalone excerpt and some output just run 
> from irb
> 
> 
> 
> require "rubygems"
> require "dm-core"
> 
> $dm = DataMapper.setup(:default, "mysql://root:@photo.rwboyer.com/wordpress")
> 
> class TermTax
>     include DataMapper::Resource
> 
>     storage_names[:default] = "rb_term_taxonomy"
> 
>     property :term_id, Integer, :field => "term_id"
>     property :tax, String, :field => "taxonomy"
>     
>     #belongs_to :term, :child_key => [ :term_id ]
>     
> end 
>     
The problem is you don't have a key.  It doesn't have to be a Serial, 
autoincrementing key, but DataMapper requires that there is some column, or 
collection of columns, which can act as a unique identifier for the record.  
These are specified via ':key => true'

Regards
Jon

-- 
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.

Reply via email to