From 4961f4d55e65db524d720bee67b9732e1d47fb20 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Thu, 1 Oct 2015 12:08:00 -0300 Subject: [PATCH] adding amount of children method to replace counter cache --- lib/ext/entities.rb | 5 +++++ 1 file changed, 5 insertions(+), 0 deletions(-) diff --git a/lib/ext/entities.rb b/lib/ext/entities.rb index 0ff447e..eeb9645 100644 --- a/lib/ext/entities.rb +++ b/lib/ext/entities.rb @@ -6,6 +6,11 @@ module Noosfero #FIXME make test class ArticleBase < Entity expose :ranking_position + #FIXME see why children counter cache is not working + expose :amount_of_children do |article, options| + article.children.count + end + end def self.included(base) -- libgit2 0.21.2