Commit 46f30e1a198d310bb704e591239c6bd9d18afc35
Committed by
Rodrigo Souto
1 parent
f5509713
Exists in
staging
and in
41 other branches
adjust display filter refactoring
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
lib/api/v1/articles.rb
| ... | ... | @@ -19,7 +19,7 @@ module API |
| 19 | 19 | # } |
| 20 | 20 | get do |
| 21 | 21 | articles = select_filtered_collection_of(environment, 'articles', params) |
| 22 | - articles = articles.where(Article.display_filter(current_user.person, nil)[:conditions]) | |
| 22 | + articles = articles.display_filter(current_user.person, nil) | |
| 23 | 23 | present articles, :with => Entities::Article |
| 24 | 24 | end |
| 25 | 25 | |
| ... | ... | @@ -32,7 +32,7 @@ module API |
| 32 | 32 | get ':id/children' do |
| 33 | 33 | article = find_article(environment.articles, params[:id]) |
| 34 | 34 | articles = select_filtered_collection_of(article, 'children', params) |
| 35 | - articles = articles.where(Article.display_filter(current_user.person, nil)[:conditions]) | |
| 35 | + articles = articles.display_filter(current_user.person, nil) | |
| 36 | 36 | present articles, :with => Entities::Article |
| 37 | 37 | end |
| 38 | 38 | |
| ... | ... | @@ -49,7 +49,7 @@ module API |
| 49 | 49 | get do |
| 50 | 50 | community = environment.communities.find(params[:community_id]) |
| 51 | 51 | articles = select_filtered_collection_of(community, 'articles', params) |
| 52 | - articles = articles.where(Article.display_filter(current_user.person, community)[:conditions]) | |
| 52 | + articles = articles.display_filter(current_user.person, community) | |
| 53 | 53 | present articles, :with => Entities::Article |
| 54 | 54 | end |
| 55 | 55 | ... | ... |