From 60354284225e8039c3a60b824b4fad2bd61165d7 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 f67f69b3..6e2e0a7b 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 86ac1f14..433f940e 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")