@@ -19,6 +19,11 class Role < ActiveRecord::Base | |||||
19 | # Built-in roles |
|
19 | # Built-in roles | |
20 | BUILTIN_NON_MEMBER = 1 |
|
20 | BUILTIN_NON_MEMBER = 1 | |
21 | BUILTIN_ANONYMOUS = 2 |
|
21 | BUILTIN_ANONYMOUS = 2 | |
|
22 | ||||
|
23 | named_scope :builtin, lambda { |*args| | |||
|
24 | compare = 'not' if args.first == true | |||
|
25 | { :conditions => "#{compare} builtin = 0" } | |||
|
26 | } | |||
22 |
|
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 |
General Comments 0
You need to be logged in to leave comments.
Login now