Created
March 26, 2010 16:31
Revisions
-
ashgti revised this gist
Mar 26, 2010 . 1 changed file with 11 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -17,10 +17,17 @@ class Comment { belongs_to('Post'); } { my $post = Post.new(title => "hello World", body => "..."); $post.save; $post.comments.new(posted_by => "Me"); $post.comments.first.save; } { my $post = Post.get(title => 'hello World'); $post.body = 'something else'; $post.save; } -
ashgti revised this gist
Mar 26, 2010 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -17,3 +17,10 @@ class Comment { belongs_to('Post'); } my $post = Post.new(title => "hello World", body => "..."); $post.save; $post.comments.new(posted_by => "Me"); $post.comments.first.save; -
ashgti created this gist
Mar 26, 2010 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ class Post { does Resource; has $id does Property(:type(Serial)); has $title does Property(:type(String)); has Text $body does Property; has_many('Comments'); } class Comment { does Resource; has $id does Property(:type(Serial)); has String $posted_by does Property; belongs_to('Post'); }