From bf59537c3fc4026757975c9644163445568dcc88 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Thu, 24 Sep 2015 21:34:05 -0300 Subject: [PATCH] expose ranking correctly --- lib/ext/entities.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/ext/entities.rb b/lib/ext/entities.rb index 4881f51..502a353 100644 --- a/lib/ext/entities.rb +++ b/lib/ext/entities.rb @@ -2,12 +2,19 @@ module Noosfero module API module Entities - class ArticleBase < Entity - expose :ranking_position do |article, options| - article.kind_of?(ProposalsDiscussionPlugin::Proposal) && article.ranking_item.present? ? article.ranking_item.position : nil + 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 end + end -- libgit2 0.21.2