Class: Bosh::Director::Models::OrphanSnapshot

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/models/orphan_snapshot.rb

Instance Method Summary collapse

Instance Method Details

#before_createObject



10
11
12
# File 'lib/bosh/director/models/orphan_snapshot.rb', line 10

def before_create
  self.created_at ||= Time.now
end

#validateObject



5
6
7
8
# File 'lib/bosh/director/models/orphan_snapshot.rb', line 5

def validate
  validates_presence [:snapshot_cid, :snapshot_created_at]
  validates_unique [:snapshot_cid]
end