class Perus::Server::Group

Public Instance Methods

after_destroy() click to toggle source
Calls superclass method
# File lib/perus/server/models/group.rb, line 12
def after_destroy
    super

    # rather than deleting all systems in a group, each system in the
    # group is just removed from the group instead. this is better than
    # accidentally removing a group and all related system data.
    systems.each do |system|
        system.group_id = nil
        system.save
    end
end
validate() click to toggle source
Calls superclass method
# File lib/perus/server/models/group.rb, line 6
def validate
    super
    validates_presence  :name
    validates_unique    :name
end