hidden guest user

This commit is contained in:
Rueshyna 2012-12-19 16:46:01 +08:00
parent 0fa1b43f06
commit 6035428422
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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")