mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
redesigned fix
This commit is contained in:
parent
42d65aef23
commit
d2ac8a30c0
2 changed files with 3 additions and 7 deletions
|
|
@ -2,13 +2,7 @@ class Admin::UsersController < ApplicationController
|
|||
before_filter :verify_admin
|
||||
|
||||
def index
|
||||
@users = User.select('users.*,
|
||||
people.last_name AS last_name,
|
||||
people.first_name AS first_name,
|
||||
people.public_name AS public_name,
|
||||
people.email AS email').
|
||||
joins(:person).load.
|
||||
order('people.last_name ASC')
|
||||
@users = User.joins(:person).order('people.last_name ASC')
|
||||
end
|
||||
|
||||
def update
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ class User < ActiveRecord::Base
|
|||
before_save :setup_role
|
||||
before_create :create_person
|
||||
|
||||
delegate :last_name, :first_name, :public_name, :email, to: :person
|
||||
|
||||
def role?(role)
|
||||
Rails.logger.debug("Checking role in user")
|
||||
return !!self.roles.find_by_name(role.to_s.camelize)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue