Commit 140ce4f88aa97aa7c94122d3d4412e3e7b993c9b
Exists in
staging
and in
4 other branches
Merge branch 'api' into production
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
lib/noosfero/api/v1/articles.rb
... | ... | @@ -39,7 +39,7 @@ module Noosfero |
39 | 39 | desc "Add a follower for the article" |
40 | 40 | post ':id/follow' do |
41 | 41 | article = find_article(environment.articles, params[:id]) |
42 | - if article.article_followers.include?(current_person) | |
42 | + if article.article_followers.exists?(:person_id => current_person.id) | |
43 | 43 | {:success => false, :already_follow => true} |
44 | 44 | else |
45 | 45 | article_follower = ArticleFollower.new | ... | ... |