1 class Category
< ActiveRecord
::Base
2 has_and_belongs_to_many
:posts
3 has_and_belongs_to_many
:special_posts, :class_name => "Post"
4 has_and_belongs_to_many
:other_posts, :class_name => "Post"
5 has_and_belongs_to_many
:posts_with_authors_sorted_by_author_id, :class_name => "Post", :include => :authors, :order => "authors.id"
7 has_and_belongs_to_many(:select_testing_posts,
9 :foreign_key => 'category_id',
10 :association_foreign_key => 'post_id',
11 :select => 'posts.*, 1 as correctness_marker')
13 has_and_belongs_to_many
:post_with_conditions,
14 :class_name => 'Post',
15 :conditions => { :title => 'Yet Another Testing Title' }
17 has_and_belongs_to_many
:posts_gruoped_by_title, :class_name => "Post", :group => "title", :select => "title"
23 has_many
:categorizations
24 has_many
:authors, :through => :categorizations, :select => 'authors.*, categorizations.post_id'
27 class SpecialCategory
< Category
30 'a special category...'