Commit 80ff6c430c49464c08a12977205c3433554f9f6d
Exists in
staging
and in
4 other branches
Merge branch 'production' of gitlab.com:participa/noosfero into production
Showing
7 changed files
with
13 additions
and
7 deletions
Show diff stats
Gemfile
... | ... | @@ -30,6 +30,7 @@ gem 'rack-cors' |
30 | 30 | gem 'rack-contrib' |
31 | 31 | gem 'liquid', '~> 3.0.3' |
32 | 32 | #gem 'grape-swagger-rails' |
33 | +gem 'rubyzip' | |
33 | 34 | |
34 | 35 | # FIXME list here all actual dependencies (i.e. the ones in debian/control), |
35 | 36 | # with their GEM names (not the Debian package names) | ... | ... |
app/models/person.rb
... | ... | @@ -4,7 +4,7 @@ class Person < Profile |
4 | 4 | attr_accessible :organization, :contact_information, :sex, :birth_date, :cell_phone, |
5 | 5 | :comercial_phone, :jabber_id, :personal_website, :nationality, :address_reference, |
6 | 6 | :district, :schooling, :schooling_status, :formation, :custom_formation, :area_of_study, |
7 | - :custom_area_of_study, :professional_activity, :organization_website, :following_articiles | |
7 | + :custom_area_of_study, :professional_activity, :organization_website, :following_articles | |
8 | 8 | |
9 | 9 | SEARCH_FILTERS = { |
10 | 10 | :order => %w[more_recent more_popular more_active], |
... | ... | @@ -89,7 +89,7 @@ class Person < Profile |
89 | 89 | |
90 | 90 | #Article followers relation |
91 | 91 | has_many :article_followers, :dependent => :destroy |
92 | - has_many :following_articiles, :class_name => 'Article', :through => :article_followers, :source => :article | |
92 | + has_many :following_articles, :class_name => 'Article', :through => :article_followers, :source => :article | |
93 | 93 | |
94 | 94 | has_many :friendships, :dependent => :destroy |
95 | 95 | has_many :friends, :class_name => 'Person', :through => :friendships | ... | ... |
lib/noosfero/api/helpers.rb
... | ... | @@ -97,8 +97,8 @@ require 'grape' |
97 | 97 | present article, :with => Entities::Article, :fields => params[:fields] |
98 | 98 | end |
99 | 99 | |
100 | - def present_articles(asset) | |
101 | - articles = find_articles(asset) | |
100 | + def present_articles(asset, method = 'articles') | |
101 | + articles = find_articles(asset, method) | |
102 | 102 | articles = paginate articles |
103 | 103 | present articles, :with => Entities::Article, :fields => params[:fields] |
104 | 104 | end | ... | ... |
lib/noosfero/api/v1/articles.rb
... | ... | @@ -25,6 +25,11 @@ module Noosfero |
25 | 25 | present_articles(environment) |
26 | 26 | end |
27 | 27 | |
28 | + desc "Return the articles followed by me" | |
29 | + get 'followed_by_me' do | |
30 | + present_articles(current_person, 'following_articles') | |
31 | + end | |
32 | + | |
28 | 33 | desc "Return the article id" |
29 | 34 | get ':id' do |
30 | 35 | present_article(environment) | ... | ... |
plugins/dialoga
plugins/gamification
test/unit/article_follower_test.rb