@@ -20,6 +20,11 class Role < ActiveRecord::Base | |||||
20 | BUILTIN_NON_MEMBER = 1 |
|
20 | BUILTIN_NON_MEMBER = 1 | |
21 | BUILTIN_ANONYMOUS = 2 |
|
21 | BUILTIN_ANONYMOUS = 2 | |
22 |
|
22 | |||
|
23 | named_scope :builtin, lambda { |*args| | |||
|
24 | compare = 'not' if args.first == true | |||
|
25 | { :conditions => "#{compare} builtin = 0" } | |||
|
26 | } | |||
|
27 | ||||
23 | before_destroy :check_deletable |
|
28 | before_destroy :check_deletable | |
24 | has_many :workflows, :dependent => :delete_all do |
|
29 | has_many :workflows, :dependent => :delete_all do | |
25 | def copy(role) |
|
30 | def copy(role) |
General Comments 0
You need to be logged in to leave comments.
Login now