diff options
author | miloops <miloops@gmail.com> | 2008-11-21 19:20:33 -0300 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-12-01 20:22:31 +0100 |
commit | 97403ad5fdfcdfb2110c6f8fd0ebf43b7afc4859 (patch) | |
tree | 77998cf59255d49323d7f7063025ca895e162f62 /activerecord/test/models/author.rb | |
parent | 0c4ba90aa1ea6a8d386c724a55a31e63a13c46ab (diff) | |
download | rails-97403ad5fdfcdfb2110c6f8fd0ebf43b7afc4859.tar.gz rails-97403ad5fdfcdfb2110c6f8fd0ebf43b7afc4859.tar.bz2 rails-97403ad5fdfcdfb2110c6f8fd0ebf43b7afc4859.zip |
Add :having option to find, to use in combination with grouped finds. Also added to has_many and has_and_belongs_to_many associations.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1028 state:committed]
Diffstat (limited to 'activerecord/test/models/author.rb')
-rw-r--r-- | activerecord/test/models/author.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/models/author.rb b/activerecord/test/models/author.rb index e5b19ff9e4..4ffac4fe32 100644 --- a/activerecord/test/models/author.rb +++ b/activerecord/test/models/author.rb @@ -1,6 +1,7 @@ class Author < ActiveRecord::Base has_many :posts has_many :posts_with_comments, :include => :comments, :class_name => "Post" + has_many :popular_grouped_posts, :include => :comments, :class_name => "Post", :group => "type", :having => "SUM(comments_count) > 1", :select => "type" has_many :posts_with_comments_sorted_by_comment_id, :include => :comments, :class_name => "Post", :order => 'comments.id' has_many :posts_sorted_by_id_limited, :class_name => "Post", :order => 'posts.id', :limit => 1 has_many :posts_with_categories, :include => :categories, :class_name => "Post" |