From cb7a9fcc218cd8f318e6fed0103a3671dbc7939e Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Thu, 2 Feb 2012 02:42:23 +0600 Subject: [PATCH] fix group autocomplete --- app/models/ability.rb | 2 +- app/models/group.rb | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/ability.rb b/app/models/ability.rb index f2412a566..735aaed2a 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -31,7 +31,7 @@ class Ability can [:show, :update], Settings::Notifier, :user_id => user.id - can [:read, :create], Group + can [:read, :create, :autocomplete_group_uname], Group can [:update, :manage_members], Group do |group| group.objects.exists?(:object_type => 'User', :object_id => user.id, :role => 'admin') # or group.owner_id = user.id end diff --git a/app/models/group.rb b/app/models/group.rb index 999c4a626..ccd4db52e 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -22,7 +22,6 @@ class Group < ActiveRecord::Base delegate :ssh_key, :to => :owner after_create :add_owner_to_members - after_initialize lambda {|r| r.name ||= r.uname } # default include Modules::Models::PersonalRepository # include Modules::Models::Owner