Adds a scope for sorting groups.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9947 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
c11f5a23fe
commit
1c825df549
|
@ -25,7 +25,7 @@ class GroupsController < ApplicationController
|
||||||
helper :custom_fields
|
helper :custom_fields
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@groups = Group.find(:all, :order => 'lastname')
|
@groups = Group.sorted.all
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
|
|
|
@ -29,6 +29,8 @@ class Group < Principal
|
||||||
|
|
||||||
before_destroy :remove_references_before_destroy
|
before_destroy :remove_references_before_destroy
|
||||||
|
|
||||||
|
scope :sorted, order("#{table_name}.lastname ASC")
|
||||||
|
|
||||||
safe_attributes 'name',
|
safe_attributes 'name',
|
||||||
'user_ids',
|
'user_ids',
|
||||||
'custom_field_values',
|
'custom_field_values',
|
||||||
|
|
Loading…
Reference in New Issue