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