Class: Perus::Server::Group
- Inherits:
-
Sequel::Model
- Object
- Sequel::Model
- Perus::Server::Group
- Defined in:
- lib/perus/server/models/group.rb
Instance Method Summary collapse
Instance Method Details
#after_destroy ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# 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 ⇒ Object
6 7 8 9 10 |
# File 'lib/perus/server/models/group.rb', line 6 def validate super validates_presence :name validates_unique :name end |