From 2bd7ffc8e7edc3048c44ac4b60651d2fc2e8d89c Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Tue, 17 May 2016 13:37:07 -0300 Subject: [PATCH] Adapt entities extension to the new api path --- lib/ext/entities.rb | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/lib/ext/entities.rb b/lib/ext/entities.rb index 9d430a1..40dcd98 100644 --- a/lib/ext/entities.rb +++ b/lib/ext/entities.rb @@ -1,24 +1,22 @@ -require File.join(Rails.root,'lib','noosfero','api','entities') -module Noosfero - module API - module Entities +require_dependency 'api/entities' - class Article < ArticleBase - expose :ranking_position - #FIXME see why children counter cache is not working - expose :amount_of_children do |article, options| - article.children.count - end - end +module Api + module Entities - class RankingItem < Entity - root :proposals, :proposal - expose :id, :position, :abstract, :body, :votes_for, :votes_against - expose :hits, :effective_support, :proposal_id, :created_at - expose :updated_at, :slug, :categories, :parent + class Article < ArticleBase + expose :ranking_position + #FIXME see why children counter cache is not working + expose :amount_of_children do |article, options| + article.children.count end + end + class RankingItem < Entity + root :proposals, :proposal + expose :id, :position, :abstract, :body, :votes_for, :votes_against + expose :hits, :effective_support, :proposal_id, :created_at + expose :updated_at, :slug, :categories, :parent end - end + end end -- libgit2 0.21.2