From 391b7c0f7e4e9214fde69f1015338a0ac133d33a Mon Sep 17 00:00:00 2001 From: Arthur Del Esposte Date: Tue, 22 Jul 2014 19:05:09 +0000 Subject: [PATCH] AI3204: Fixing People block plugin bug --- plugins/people_block/controllers/people_block_plugin_profile_controller.rb | 2 +- plugins/people_block/test/functional/people_block_plugin_profile_controller_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/people_block/controllers/people_block_plugin_profile_controller.rb b/plugins/people_block/controllers/people_block_plugin_profile_controller.rb index dd3ee0e..f8afe3b 100644 --- a/plugins/people_block/controllers/people_block_plugin_profile_controller.rb +++ b/plugins/people_block/controllers/people_block_plugin_profile_controller.rb @@ -4,7 +4,7 @@ class PeopleBlockPluginProfileController < ProfileController def members if is_cache_expired?(profile.members_cache_key(params)) - if(params[:role_key]) + unless params[:role_key].blank? role = Role.find_by_key_and_environment_id(params[:role_key], profile.environment) @members = profile.members.with_role(role.id).includes(relations_to_include).paginate(:per_page => members_per_page, :page => params[:npage]) @members_title = role.name diff --git a/plugins/people_block/test/functional/people_block_plugin_profile_controller_test.rb b/plugins/people_block/test/functional/people_block_plugin_profile_controller_test.rb index cd5ae8b..f0901e4 100644 --- a/plugins/people_block/test/functional/people_block_plugin_profile_controller_test.rb +++ b/plugins/people_block/test/functional/people_block_plugin_profile_controller_test.rb @@ -34,7 +34,7 @@ class PeopleBlockPluginProfileControllerTest < ActionController::TestCase attr_accessor :profile, :block, :admin, :member, :moderator should 'list members without role_key' do - get :members, :profile => profile.identifier + get :members, :profile => profile.identifier, :role_key => "" assert_response :success assert_template 'members' assert_equivalent [@admin, @member, @moderator], assigns(:members) -- libgit2 0.21.2