Revision 3034e8e2
Added by Ori Rabin almost 10 years ago
app/models/usergroup.rb | ||
---|---|---|
audited :allow_mass_assignment => true
|
||
include Authorizable
|
||
|
||
validates_lengths_from_database
|
||
before_destroy EnsureNotUsedBy.new(:hosts), :ensure_last_admin_group_is_not_deleted
|
||
|
||
has_many :user_roles, :dependent => :destroy, :foreign_key => 'owner_id', :conditions => {:owner_type => self.to_s}
|
||
... | ... | |
has_many :parents, :through => :usergroup_parents, :source => :usergroup, :dependent => :destroy
|
||
|
||
has_many_hosts :as => :owner
|
||
validates :name, :uniqueness => true, :length => { :maximum => 255 }, :presence => true
|
||
validates :name, :uniqueness => true, :presence => true
|
||
|
||
# The text item to see in a select dropdown menu
|
||
alias_attribute :select_title, :to_s
|
Also available in: Unified diff
fixes #6636, #6657, #6694 - add field length validations, extend audit field length