Class: ActiveAcl::AclSection

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/active_acl/acl_section.rb

Instance Method Summary collapse

Instance Method Details

#before_destroyObject

Make shure there are no associated acls before destroying a section



13
14
15
16
17
18
19
20
# File 'lib/active_acl/acl_section.rb', line 13

def before_destroy
  if members.empty?
    true
  else
    errors.add_to_base("Can't delete a section with associated ACLs")
    false
  end
end