Commit 9779138589abd6f3be5f43dbef0221247d89c8aa
Committed by
Rodrigo Souto
1 parent
7bc23599
Exists in
master
and in
29 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,7 +19,7 @@ module API | ||
19 | # } | 19 | # } |
20 | get do | 20 | get do |
21 | articles = select_filtered_collection_of(environment, 'articles', params) | 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 | present articles, :with => Entities::Article | 23 | present articles, :with => Entities::Article |
24 | end | 24 | end |
25 | 25 | ||
@@ -32,7 +32,7 @@ module API | @@ -32,7 +32,7 @@ module API | ||
32 | get ':id/children' do | 32 | get ':id/children' do |
33 | article = find_article(environment.articles, params[:id]) | 33 | article = find_article(environment.articles, params[:id]) |
34 | articles = select_filtered_collection_of(article, 'children', params) | 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 | present articles, :with => Entities::Article | 36 | present articles, :with => Entities::Article |
37 | end | 37 | end |
38 | 38 | ||
@@ -49,7 +49,7 @@ module API | @@ -49,7 +49,7 @@ module API | ||
49 | get do | 49 | get do |
50 | community = environment.communities.find(params[:community_id]) | 50 | community = environment.communities.find(params[:community_id]) |
51 | articles = select_filtered_collection_of(community, 'articles', params) | 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 | present articles, :with => Entities::Article | 53 | present articles, :with => Entities::Article |
54 | end | 54 | end |
55 | 55 |