Skip to content

Instantly share code, notes, and snippets.

@lumpidu
Created April 26, 2011 22:48
Show Gist options
  • Save lumpidu/943360 to your computer and use it in GitHub Desktop.
Save lumpidu/943360 to your computer and use it in GitHub Desktop.
datamapper prob1
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
@lumpidu
Copy link
Author

lumpidu commented Apr 26, 2011

Produces 'Cannot find the child_model FeedPost for Feed in feed_posts (NameError)'
Why ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment