Sha256: 188639bc0bc04857dcc0fc41c15a016c10d6b191f072012dcb522f24c32cbce6
Contents?: true
Size: 1.09 KB
Versions: 3
Compression:
Stored size: 1.09 KB
Contents
module Orchestrator class Zone < Couchbase::Model design_document :zone include ::CouchbaseId::Generator attribute :name attribute :description attribute :settings, default: lambda { {} } attribute :created_at, default: lambda { Time.now.to_i } # Loads all the zones def self.all all(stale: false) end view :all protected validates :name, presence: true before_delete :remove_zone def remove_zone ::Orchestrator::Control.instance.zones.delete(self.id) ::Orchestrator::ControlSystem.in_zone(self.id).each do |cs| cs.zones.delete(self.id) cs.save end end # Expire both the zone cache and any systems that use the zone after_save :expire_caches def expire_caches ::Orchestrator::Control.instance.zones[self.id] = self ::Orchestrator::ControlSystem.in_zone(self.id).each do |cs| cs.expire_cache end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
orchestrator-1.0.3 | app/models/orchestrator/zone.rb |
orchestrator-1.0.2 | app/models/orchestrator/zone.rb |
orchestrator-1.0.1 | app/models/orchestrator/zone.rb |