mirror of
https://github.com/meineerde/redmine.git
synced 2026-03-11 03:33:07 +00:00
add builtin named_scope
git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1792 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f5f51f4f83
commit
562d3aa6a6
@ -19,6 +19,11 @@ class Role < ActiveRecord::Base
|
||||
# Built-in roles
|
||||
BUILTIN_NON_MEMBER = 1
|
||||
BUILTIN_ANONYMOUS = 2
|
||||
|
||||
named_scope :builtin, lambda { |*args|
|
||||
compare = 'not' if args.first == true
|
||||
{ :conditions => "#{compare} builtin = 0" }
|
||||
}
|
||||
|
||||
before_destroy :check_deletable
|
||||
has_many :workflows, :dependent => :delete_all do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user