include HasUuid
include KindAndEtag
include CommonApiTemplate
- serialize :info, Hash
- serialize :properties, Hash
+
+ # Posgresql JSONB columns should NOT be declared as serialized, Rails 5
+ # already know how to properly treat them.
+
+ before_validation :fill_field_defaults
before_validation :ensure_ping_secret
after_update :dns_server_update
protected
+ def fill_field_defaults
+ self.info ||= {}
+ self.properties ||= {}
+ end
+
def assign_hostname
if self.hostname.nil? and Rails.configuration.assign_node_hostname
self.hostname = self.class.hostname_for_slot(self.slot_number)