summaryrefslogtreecommitdiff
path: root/app/models/group.rb
blob: c45953012d61badefa9ac88a9d56a9796258253f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Group < ActiveRecord::Base
  attr_accessible :name, :active, :comment

  has_many :group_memberships, :dependent => :destroy
  has_many :group_permissions, :dependent => :destroy
  has_many :permittances, :foreign_key => :target_group_id, :class_name => "GroupPermission", :dependent => :destroy

  validates :name,
            :presence => true

  def to_s
    self.name
  end
end