diff options
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r-- | activerecord/test/fixtures/category.rb | 12 | ||||
-rw-r--r-- | activerecord/test/fixtures/comment.rb | 24 | ||||
-rw-r--r-- | activerecord/test/fixtures/post.rb | 4 |
3 files changed, 37 insertions, 3 deletions
diff --git a/activerecord/test/fixtures/category.rb b/activerecord/test/fixtures/category.rb index 822defa03e..880eb1573d 100644 --- a/activerecord/test/fixtures/category.rb +++ b/activerecord/test/fixtures/category.rb @@ -1,5 +1,15 @@ class Category < ActiveRecord::Base has_and_belongs_to_many :posts + + def self.what_are_you + 'a category...' + end end -class SpecialCategory < Category; end; +class SpecialCategory < Category + + def self.what_are_you + 'a special category...' + end + +end 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; diff --git a/activerecord/test/fixtures/post.rb b/activerecord/test/fixtures/post.rb index e347d94fb8..f5adac41dc 100644 --- a/activerecord/test/fixtures/post.rb +++ b/activerecord/test/fixtures/post.rb @@ -5,6 +5,10 @@ class Post < ActiveRecord::Base has_many :special_comments, :class_name => "SpecialComment" has_and_belongs_to_many :categories has_and_belongs_to_many :special_categories, :join_table => "categories_posts" + + def self.what_are_you + 'a post...' + end end class SpecialPost < Post; end; |