Hi,

I am learning DM, so please be forgiving ..

Here's the model:


class Feed
  include DataMapper::Resource

  property :id,    Serial
  property :title, String, :key => true
  property :url,   Text

  has n, :feed_posts
  has n, :posts, :through => feed_posts

end

class FeedPost
  include DataMapper::Resource

  property  :id,    Serial
  property  :feed_title, String,  :key=>true, :required => true
  property  :post_title, String,  :key=>true, :required => true

  belongs_to  :feed
  belongs_to  :post
end

class Post
  include DataMapper::Resource

  property  :id,          Serial
  property  :title,       String, :key=> true
  property  :url,         Text
  property  :timestamp,   DateTime
  property  :content_raw, Text

  has 1, :feed_post
  has 1, :feed, :through => feed_post
end


Basically I want FeedPost to be the JOIN of the tables Feed and Post.
The combined titles of a feed and a post should be unique.
The above model produces: 'Cannot find the child_model FeedPost for
Feed in feed_posts (NameError)'. What am I doing wrong here ?

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