Commit 4961f4d55e65db524d720bee67b9732e1d47fb20
1 parent
6492242b
Exists in
master
and in
5 other branches
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 | #FIXME make test |
7 | 7 | class ArticleBase < Entity |
8 | 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 | 14 | end |
10 | 15 | |
11 | 16 | def self.included(base) | ... | ... |