Commit 3a7be1653c2da38239596153df14dcfc41ee2c8e
1 parent
41b08226
Exists in
stable-spb-1.4
and in
8 other branches
Fix API using rails3
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
lib/noosfero/api/entities.rb
@@ -15,7 +15,7 @@ module Noosfero | @@ -15,7 +15,7 @@ module Noosfero | ||
15 | } | 15 | } |
16 | 16 | ||
17 | def self.can_display? profile, options, field, permission = :friend | 17 | def self.can_display? profile, options, field, permission = :friend |
18 | - return true if profile.public_fields.include?(field) | 18 | + return true if profile.public_fields.map{|field| field.to_sym}.include?(field.to_sym) |
19 | current_person = options[:current_person] | 19 | current_person = options[:current_person] |
20 | 20 | ||
21 | current_permission = if current_person.present? | 21 | current_permission = if current_person.present? |
lib/noosfero/api/v1/search.rb
@@ -13,7 +13,7 @@ module Noosfero | @@ -13,7 +13,7 @@ module Noosfero | ||
13 | context = environment | 13 | context = environment |
14 | 14 | ||
15 | profile = environment.profiles.find(params[:profile_id]) if params[:profile_id] | 15 | profile = environment.profiles.find(params[:profile_id]) if params[:profile_id] |
16 | - scope = profile.nil? ? environment.articles.is_public : profile.articles.is_public | 16 | + scope = profile.nil? ? environment.articles.public : profile.articles.public |
17 | scope = scope.where(:type => params[:type]) if params[:type] && !(params[:type] == 'Article') | 17 | scope = scope.where(:type => params[:type]) if params[:type] && !(params[:type] == 'Article') |
18 | scope = scope.where(:parent_id => params[:parent_id]) if params[:parent_id].present? | 18 | scope = scope.where(:parent_id => params[:parent_id]) if params[:parent_id].present? |
19 | scope = scope.joins(:categories).where(:categories => {:id => params[:category_ids]}) if params[:category_ids].present? | 19 | scope = scope.joins(:categories).where(:categories => {:id => params[:category_ids]}) if params[:category_ids].present? |