From 3d39c2c3c347c96e560a1e899ddf065c8945b2a2 Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Wed, 19 Dec 2012 16:46:01 +0800 Subject: [PATCH] hidden guest user --- app/controllers/admin/users_new_interface_controller.rb | 6 +++--- app/models/user/user.rb | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/users_new_interface_controller.rb b/app/controllers/admin/users_new_interface_controller.rb index f67f69b39..6e2e0a7bd 100644 --- a/app/controllers/admin/users_new_interface_controller.rb +++ b/app/controllers/admin/users_new_interface_controller.rb @@ -17,13 +17,13 @@ class Admin::UsersNewInterfaceController < OrbitBackendController render case params[:at] when 'summary' - @users=User.page(page_num).per(12).includes('avatar') + @users=User.not_guest_user.page(page_num).per(12).includes('avatar') "index_summary" when 'thumbnail' - @users=User.page(page_num).per(36).includes('avatar') + @users=User.not_guest_user.page(page_num).per(36).includes('avatar') "index_thumbnail" else - @users=User.page(page_num).per(10).includes('avatar') + @users=User.not_guest_user.page(page_num).per(10).includes('avatar') "index" end end diff --git a/app/models/user/user.rb b/app/models/user/user.rb index 86ac1f141..433f940ed 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -34,6 +34,7 @@ class User before_save :rebuild_status_record before_save :save_roles scope :remote_account, where(:nccu_id.ne => nil) + scope :not_guest_user, all_of(:name.ne => "guest") # validates_uniqueness_of :email,:message=> I18n.t("devise.registrations.email_not_unique")