my_profile and admin/ordergroups.
This commit is contained in:
parent
a787b3cf24
commit
c173cf4a6a
14 changed files with 92 additions and 225 deletions
|
|
@ -3,9 +3,8 @@
|
|||
class Group < ActiveRecord::Base
|
||||
has_many :memberships, :dependent => :destroy
|
||||
has_many :users, :through => :memberships
|
||||
|
||||
validates_length_of :name, :in => 1..25
|
||||
validates_uniqueness_of :name
|
||||
|
||||
validates :name, :presence => true, :length => {:in => 1..25}, :uniqueness => true
|
||||
validate :last_admin_on_earth, :on => :update
|
||||
|
||||
before_destroy :check_last_admin_group
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue