From 8ff2fb6f3aa6140f5a8bd018d5919a8a1e707cda Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sat, 23 Jan 2010 13:40:38 +0530 Subject: Make default_scope work with Relations --- activerecord/test/models/post.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/test/models/post.rb') diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb index f48b35486c..704313649a 100644 --- a/activerecord/test/models/post.rb +++ b/activerecord/test/models/post.rb @@ -100,3 +100,8 @@ end class SubStiPost < StiPost self.table_name = Post.table_name end + +class PostWithComment < ActiveRecord::Base + self.table_name = 'posts' + default_scope where("posts.comments_count > 0").order("posts.comments_count ASC") +end -- cgit v1.2.3