From 5aa7a5fa14d9ba12b0588696449a5a89c60c1092 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Thu, 1 Oct 2015 13:41:49 -0300 Subject: [PATCH] expose ranking and amount_of_children correctly --- lib/ext/entities.rb | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/lib/ext/entities.rb b/lib/ext/entities.rb index eeb9645..d29b104 100644 --- a/lib/ext/entities.rb +++ b/lib/ext/entities.rb @@ -3,26 +3,16 @@ module Noosfero module API module Entities - #FIXME make test - class ArticleBase < Entity + class Article < ArticleBase +#FIXME Leandro changed the method to model +# expose :ranking_position do |article, options| +# article.kind_of?(ProposalsDiscussionPlugin::Proposal) && article.ranking_item.present? ? article.ranking_item.position : nil +# end 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) - base.extend(ClassMethods) - end - - module ClassMethods - class ArticleBase < Entity - expose :ranking_position do |article, options| - article.kind_of?(ProposalsDiscussionPlugin::Proposal) && article.ranking_item.present? ? article.ranking_item.position : nil - end - end end end -- libgit2 0.21.2