aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorJosh Susser <josh@hasmanythrough.com>2011-11-29 09:14:21 -0800
committerJosh Susser <josh@hasmanythrough.com>2011-11-29 09:14:21 -0800
commitc347b3c06c2867badce5e22ecfbed3e972960c29 (patch)
treee7a20c133a5688ce3a7f51c171f89d7f7dd34137 /activerecord/test/models
parent124c97fbe201f810d77f807ce69f37148e903c44 (diff)
downloadrails-c347b3c06c2867badce5e22ecfbed3e972960c29.tar.gz
rails-c347b3c06c2867badce5e22ecfbed3e972960c29.tar.bz2
rails-c347b3c06c2867badce5e22ecfbed3e972960c29.zip
don't change class definition in test case
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/post.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb
index 198a963cbc..137cee3752 100644
--- a/activerecord/test/models/post.rb
+++ b/activerecord/test/models/post.rb
@@ -24,6 +24,10 @@ class Post < ActiveRecord::Base
belongs_to :author_with_posts, :class_name => "Author", :foreign_key => :author_id, :include => :posts
belongs_to :author_with_address, :class_name => "Author", :foreign_key => :author_id, :include => :author_address
+ def first_comment
+ super.body
+ end
+ has_one :first_comment, :class_name => 'Comment', :order => 'id ASC'
has_one :last_comment, :class_name => 'Comment', :order => 'id desc'
scope :with_special_comments, :joins => :comments, :conditions => {:comments => {:type => 'SpecialComment'} }