Commit bf59537c3fc4026757975c9644163445568dcc88
1 parent
21a93390
Exists in
master
and in
6 other branches
expose ranking correctly
Showing
1 changed file
with
10 additions
and
3 deletions
Show diff stats
lib/ext/entities.rb
| ... | ... | @@ -2,12 +2,19 @@ module Noosfero |
| 2 | 2 | module API |
| 3 | 3 | module Entities |
| 4 | 4 | |
| 5 | - class ArticleBase < Entity | |
| 6 | - expose :ranking_position do |article, options| | |
| 7 | - article.kind_of?(ProposalsDiscussionPlugin::Proposal) && article.ranking_item.present? ? article.ranking_item.position : nil | |
| 5 | + def self.included(base) | |
| 6 | + base.extend(ClassMethods) | |
| 7 | + end | |
| 8 | + | |
| 9 | + module ClassMethods | |
| 10 | + class ArticleBase < Entity | |
| 11 | + expose :ranking_position do |article, options| | |
| 12 | + article.kind_of?(ProposalsDiscussionPlugin::Proposal) && article.ranking_item.present? ? article.ranking_item.position : nil | |
| 13 | + end | |
| 8 | 14 | end |
| 9 | 15 | end |
| 10 | 16 | |
| 11 | 17 | end |
| 12 | 18 | end |
| 19 | + | |
| 13 | 20 | end | ... | ... |