From aa3e4e70b5979428a10791339f87c46217c63af1 Mon Sep 17 00:00:00 2001 From: Aaron Pfeifer Date: Mon, 13 Apr 2009 21:52:11 -0400 Subject: [PATCH] Minor doc / formatting tweaks --- README.rdoc | 12 ++++-------- test/app_root/app/models/article.rb | 3 +-- test/app_root/app/models/author.rb | 3 +-- test/app_root/app/models/comment.rb | 8 +++----- test/app_root/app/models/page.rb | 3 +-- test/app_root/app/models/user.rb | 5 ++--- 6 files changed, 12 insertions(+), 22 deletions(-) diff --git a/README.rdoc b/README.rdoc index 7a89186..5187849 100644 --- a/README.rdoc +++ b/README.rdoc @@ -28,8 +28,7 @@ knowing the type of model your interacting with. For example, a typical polymorphic assocation looks like the following: class Tag < ActiveRecord::Base - belongs_to :taggable, - :polymorphic => true + belongs_to :taggable, :polymorphic => true end When getting the taggable record, you would normally have to call @@ -45,10 +44,8 @@ class name. === Example class Comment < ActiveRecord::Base - belongs_to :commentable, - :polymorphic => true - belongs_to :commenter, - :polymorphic => true + belongs_to :commentable, :polymorphic => true + belongs_to :commenter, :polymorphic => true end class Article < ActiveRecord::Base @@ -56,8 +53,7 @@ class name. end class User < ActiveRecord::Base - has_many :comments, - :as => :commenter + has_many :comments, :as => :commenter end c = Comment.find(1) # => # diff --git a/test/app_root/app/models/article.rb b/test/app_root/app/models/article.rb index 2c66621..6e2acfc 100644 --- a/test/app_root/app/models/article.rb +++ b/test/app_root/app/models/article.rb @@ -1,5 +1,4 @@ class Article < ActiveRecord::Base belongs_to :author - has_many :comments, - :as => :commentable + has_many :comments, :as => :commentable end diff --git a/test/app_root/app/models/author.rb b/test/app_root/app/models/author.rb index 1ede64b..3992581 100644 --- a/test/app_root/app/models/author.rb +++ b/test/app_root/app/models/author.rb @@ -1,6 +1,5 @@ class Author < ActiveRecord::Base has_many :articles has_many :pages - has_many :comments, - :as => :commenter + has_many :comments, :as => :commenter end diff --git a/test/app_root/app/models/comment.rb b/test/app_root/app/models/comment.rb index 7ffce04..5bcb62e 100644 --- a/test/app_root/app/models/comment.rb +++ b/test/app_root/app/models/comment.rb @@ -1,6 +1,4 @@ class Comment < ActiveRecord::Base - belongs_to :commentable, - :polymorphic => true - belongs_to :commenter, - :polymorphic => true -end \ No newline at end of file + belongs_to :commentable, :polymorphic => true + belongs_to :commenter, :polymorphic => true +end diff --git a/test/app_root/app/models/page.rb b/test/app_root/app/models/page.rb index 1cb6568..c49f0c6 100644 --- a/test/app_root/app/models/page.rb +++ b/test/app_root/app/models/page.rb @@ -1,5 +1,4 @@ class Page < ActiveRecord::Base belongs_to :author - has_many :comments, - :as => :commentable + has_many :comments, :as => :commentable end diff --git a/test/app_root/app/models/user.rb b/test/app_root/app/models/user.rb index 92a6bd3..fb518a4 100644 --- a/test/app_root/app/models/user.rb +++ b/test/app_root/app/models/user.rb @@ -1,4 +1,3 @@ class User < ActiveRecord::Base - has_many :comments, - :as => :commenter -end \ No newline at end of file + has_many :comments, :as => :commenter +end