Sha256: 4d1640d634bcf1d42461dc85f30a8b86bc74418d30f9e99e47d7113b2f0d6b60
Contents?: true
Size: 673 Bytes
Versions: 41
Compression:
Stored size: 673 Bytes
Contents
module Perus::Server class Group < Sequel::Model plugin :validation_helpers one_to_many :systems def validate super validates_presence :name validates_unique :name end 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 end end
Version data entries
41 entries across 41 versions & 1 rubygems