Commit 4961f4d55e65db524d720bee67b9732e1d47fb20

Authored by Leandro Santos
1 parent 6492242b

adding amount of children method to replace counter cache

Showing 1 changed file with 5 additions and 0 deletions   Show diff stats
lib/ext/entities.rb
@@ -6,6 +6,11 @@ module Noosfero @@ -6,6 +6,11 @@ module Noosfero
6 #FIXME make test 6 #FIXME make test
7 class ArticleBase < Entity 7 class ArticleBase < Entity
8 expose :ranking_position 8 expose :ranking_position
  9 + #FIXME see why children counter cache is not working
  10 + expose :amount_of_children do |article, options|
  11 + article.children.count
  12 + end
  13 +
9 end 14 end
10 15
11 def self.included(base) 16 def self.included(base)