Skip to content

Commit

Permalink
fixed the README
Browse files Browse the repository at this point in the history
  • Loading branch information
Linki authored and Daniel Neighman committed Feb 9, 2010
1 parent 0368b0d commit 1255044
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ h2. Example Usage.
class Comment
include DataMapper::Resource

property :id, Integer, :serial => true
property :id, Serial
property :text, String

belongs_to :commentable, :polymorphic => true
Expand All @@ -31,7 +31,7 @@ h2. Example Usage.
class Post
include DataMapper::Resource

property :id, Integer, :serial => true
property :id, Serial
property :name, String

has n, :comments, :as => :commentable
Expand All @@ -45,7 +45,7 @@ h2. Example Usage.
class Article
include DataMapper::Resource

property :id, Integer, :serial => true
property :id, Serial
property :name, String

has n, :comments, :as => :commentable
Expand All @@ -68,10 +68,10 @@ This will then provide the following methods
</pre>

<pre>
article = Article.create(:name => "item6")
post = Post.create(:name => "item7")
c1 = Comment.new(:text => "comment6")
c2 = Comment.new(:text => "comment7")
article = Article.create
post = Post.create
c1 = Comment.new
c2 = Comment.new
post.comments << c1
post.save
article.comments << c2
Expand Down
6 changes: 3 additions & 3 deletions spec/dm-polymorphic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
class Comment
include DataMapper::Resource

is :polymorphic, :commentable if SYNTAX == :original
belongs_to :commentable, :polymorphic => true if SYNTAX == :new

property :id, Serial
property :text, String

is :polymorphic, :commentable if SYNTAX == :original
belongs_to :commentable, :polymorphic => true if SYNTAX == :new
end

class Post
Expand Down

0 comments on commit 1255044

Please sign in to comment.