added class methods for ActiveRecord queries