yup http://guides.rubyonrails.org/active_record_querying.html#scopes