aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures/comment.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-07-22 20:05:42 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-07-22 20:05:42 +0000
commit34f9d30e399050e776263441ee1d4415d0b2c254 (patch)
tree104acd17ac26f01436de6149e374ed9b43205e06 /activerecord/test/fixtures/comment.rb
parentea8f3f0a3765883c993cdd1c28ae958f097d2632 (diff)
downloadrails-34f9d30e399050e776263441ee1d4415d0b2c254.tar.gz
rails-34f9d30e399050e776263441ee1d4415d0b2c254.tar.bz2
rails-34f9d30e399050e776263441ee1d4415d0b2c254.zip
Added support for calling constrained class methods on has_many and has_and_belongs_to_many collections #1764 [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1894 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures/comment.rb')
-rw-r--r--activerecord/test/fixtures/comment.rb24
1 files changed, 22 insertions, 2 deletions
diff --git a/activerecord/test/fixtures/comment.rb b/activerecord/test/fixtures/comment.rb
index 982cbc6a7a..0605fd7046 100644
--- a/activerecord/test/fixtures/comment.rb
+++ b/activerecord/test/fixtures/comment.rb
@@ -1,7 +1,27 @@
class Comment < ActiveRecord::Base
belongs_to :post
+
+ def self.what_are_you
+ 'a comment...'
+ end
+
+ def self.search_by_type(q)
+ self.find(:all, :conditions => ['type = ?', q])
+ end
end
-class SpecialComment < Comment; end;
+class SpecialComment < Comment;
-class VerySpecialComment < Comment; end;
+ def self.what_are_you
+ 'a special comment...'
+ end
+
+end;
+
+class VerySpecialComment < Comment;
+
+ def self.what_are_you
+ 'a very special comment...'
+ end
+
+end;