Commit 2bd7ffc8e7edc3048c44ac4b60651d2fc2e8d89c
1 parent
b9ea1588
Exists in
master
and in
2 other branches
Adapt entities extension to the new api path
Showing
1 changed file
with
15 additions
and
17 deletions
Show diff stats
lib/ext/entities.rb
| 1 | -require File.join(Rails.root,'lib','noosfero','api','entities') | |
| 2 | -module Noosfero | |
| 3 | - module API | |
| 4 | - module Entities | |
| 1 | +require_dependency 'api/entities' | |
| 5 | 2 | |
| 6 | - class Article < ArticleBase | |
| 7 | - expose :ranking_position | |
| 8 | - #FIXME see why children counter cache is not working | |
| 9 | - expose :amount_of_children do |article, options| | |
| 10 | - article.children.count | |
| 11 | - end | |
| 12 | - end | |
| 3 | +module Api | |
| 4 | + module Entities | |
| 13 | 5 | |
| 14 | - class RankingItem < Entity | |
| 15 | - root :proposals, :proposal | |
| 16 | - expose :id, :position, :abstract, :body, :votes_for, :votes_against | |
| 17 | - expose :hits, :effective_support, :proposal_id, :created_at | |
| 18 | - expose :updated_at, :slug, :categories, :parent | |
| 6 | + class Article < ArticleBase | |
| 7 | + expose :ranking_position | |
| 8 | + #FIXME see why children counter cache is not working | |
| 9 | + expose :amount_of_children do |article, options| | |
| 10 | + article.children.count | |
| 19 | 11 | end |
| 12 | + end | |
| 20 | 13 | |
| 14 | + class RankingItem < Entity | |
| 15 | + root :proposals, :proposal | |
| 16 | + expose :id, :position, :abstract, :body, :votes_for, :votes_against | |
| 17 | + expose :hits, :effective_support, :proposal_id, :created_at | |
| 18 | + expose :updated_at, :slug, :categories, :parent | |
| 21 | 19 | end |
| 22 | - end | |
| 23 | 20 | |
| 21 | + end | |
| 24 | 22 | end | ... | ... |