From 1372f51e752896fe3057afb58d0ded9544d84c11 Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Wed, 19 Dec 2012 18:51:17 +0800 Subject: [PATCH] .not_guest_user --- app/controllers/admin/member_selects_controller.rb | 2 +- app/controllers/admin/module_apps_new_interface_controller.rb | 4 ++-- .../admin/object_auths_new_interface_controller.rb | 4 ++-- app/models/user/user.rb | 2 +- .../panel/announcement/back_end/approvals_controller.rb | 2 +- .../back_end/fact_checks/_privilege_user.html.erb | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/admin/member_selects_controller.rb b/app/controllers/admin/member_selects_controller.rb index a8ec1097..c4a4bf42 100644 --- a/app/controllers/admin/member_selects_controller.rb +++ b/app/controllers/admin/member_selects_controller.rb @@ -59,7 +59,7 @@ class Admin::MemberSelectsController < ApplicationController # @member_select_results = Role.excludes('disabled' => true) - @member_select_results = User.where(:sub_role_ids.in => params[:member_selects][:sub_role]) + @member_select_results = User.not_guest_user.where(:sub_role_ids.in => params[:member_selects][:sub_role]) @member_select_search_url = admin_member_select_member_select_add_path('member_select_add') diff --git a/app/controllers/admin/module_apps_new_interface_controller.rb b/app/controllers/admin/module_apps_new_interface_controller.rb index 2fd7685e..e1b66eac 100644 --- a/app/controllers/admin/module_apps_new_interface_controller.rb +++ b/app/controllers/admin/module_apps_new_interface_controller.rb @@ -6,7 +6,7 @@ class Admin::ModuleAppsNewInterfaceController < OrbitBackendController layout "new_admin" def setting - @sys_users = User.all(conditions: {admin: false}).includes(:avatar) + @sys_users = User.all(conditions: {admin: false}).includes(:avatar).not_guest_user @module_app = ModuleApp.find(params[:module_app_id]) @options_from_collection_for_select_bulletin_categorys = [@module_app].collect{|ma| [ma.title,ma.id] } # if params.has_key? :category @@ -64,4 +64,4 @@ class Admin::ModuleAppsNewInterfaceController < OrbitBackendController -end \ No newline at end of file +end diff --git a/app/controllers/admin/object_auths_new_interface_controller.rb b/app/controllers/admin/object_auths_new_interface_controller.rb index 973f4215..85eddd05 100644 --- a/app/controllers/admin/object_auths_new_interface_controller.rb +++ b/app/controllers/admin/object_auths_new_interface_controller.rb @@ -5,7 +5,7 @@ class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController def setting - @sys_users = User.all(conditions: {admin: false}).includes(:avatar) + @sys_users = User.all(conditions: {admin: false}).includes(:avatar).not_guest_user @ob_auth = ObjectAuth.find params[:object_auth_id] @options_from_collection_for_select_ob_auth = @ob_auth.siblings.collect{|oa| [oa.auth_obj.pp_object,oa.id] } @users_array = @ob_auth.privilege_users rescue [] @@ -87,4 +87,4 @@ class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController @module_app = ModuleApp.first(conditions: {:key => @app_key} ) end -end \ No newline at end of file +end diff --git a/app/models/user/user.rb b/app/models/user/user.rb index 433f940e..c9dffd70 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -116,7 +116,7 @@ class User end def self.find_by_subrole_and_status(sub_role_id,status_id) #Query for users by using specific sub_role and status key by within ID - User.where("status_record.#{sub_role_id}" => status_id,:sub_role_ids.in => [ sub_role_id ]) + User.not_guest_user.where("status_record.#{sub_role_id}" => status_id,:sub_role_ids.in => [ sub_role_id ]) end def self.find_by_status(status_id) diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb index 91f610b6..0fce4469 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb @@ -21,7 +21,7 @@ class Panel::Announcement::BackEnd::ApprovalsController < OrbitBackendControlle end def setting - @sys_users = User.all(conditions: {admin: false}).includes(:avatar) + @sys_users = User.all(conditions: {admin: false}).includes(:avatar).not_guest_user @bulletin_categorys = BulletinCategory.all @options_from_collection_for_select_bulletin_categorys = @bulletin_categorys.collect{|bc| [bc.title,bc.id] } if params.has_key? :category diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_privilege_user.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_privilege_user.html.erb index 207367a0..ea3e709e 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_privilege_user.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_privilege_user.html.erb @@ -1,5 +1,5 @@ <%= content_tag :div ,:id => "users_checkbox_ary",:class => 'clear' do -%> -<% sys_users = User.all -%> +<% sys_users = User.all.not_guest_user -%> <% sys_users.each do |user| -%>