Commit 9eaeb5aac2dcbc16baf99e556daa9700cda71f28

Authored by Leandro Santos
1 parent bf59537c

adding raking position to articles

Showing 2 changed files with 15 additions and 0 deletions   Show diff stats
lib/ext/article.rb 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +require_dependency 'article'
  2 +
  3 +class Article
  4 +
  5 + def ranking_position
  6 + self.kind_of?(ProposalsDiscussionPlugin::Proposal) && self.ranking_item.present? ? self.ranking_item.position : nil
  7 + end
  8 +
  9 +end
... ...
lib/ext/entities.rb
  1 +require File.join(Rails.root,'lib','noosfero','api','entities')
1 2 module Noosfero
2 3 module API
3 4 module Entities
4 5  
  6 + #FIXME make test
  7 + class Person < Profile
  8 + expose :ranking_position
  9 + end
  10 +
5 11 def self.included(base)
6 12 base.extend(ClassMethods)
7 13 end
... ...