Suppose I have a Post model, and a Comment model. Using a common pattern, Post has_many Comments.
If Comment has a default_scope set:
default_scope w
class Comment def post_comments(post_id) with_exclusive_scope { find(all, :conditions => {:post_id => post_id}) } end end Comment.post_comments(Post.first.id)