Some people will disagree, but I feel the query scoping you are
looking is better located in the controller than in the model.
There is a plugin that seems to solve this very problem:
Look at the example (3rd screen down) at
It let's you write code like this :
class PostsController < ApplicationController
# Displays the posts of the logged in user.
@posts = Post.find(:all)
Personally, I don't feel enough pain to use this way, so I'd write it
the 'old' way ,along:
my_bucket = Bucket.find(:conditions => ...)
all_my_folders = my_bucket.folders