Created
April 26, 2011 22:48
-
-
Save lumpidu/943360 to your computer and use it in GitHub Desktop.
datamapper prob1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Produces 'Cannot find the child_model FeedPost for Feed in feed_posts (NameError)'
Why ?