Module: Noodall::Articles::Categories

Included in:
Article, ArticleList
Defined in:
lib/noodall/articles/categories.rb

Instance Method Summary collapse

Instance Method Details

#all_categories(query = {}) ⇒ Object



5
6
7
8
9
# File 'lib/noodall/articles/categories.rb', line 5

def all_categories(query = {})
  result = self.collection.map_reduce(category_map, category_reduce, {:query => query, :out => "tmp_categories"})
  categories = result.find.to_a.map{|c| c['_id']}
  categories.sort
end