lib/dcmgr/models/vlan_lease.rb in wakame-vdc-agents-10.12.0 vs lib/dcmgr/models/vlan_lease.rb in wakame-vdc-agents-11.06.0
- old
+ new
@@ -11,7 +11,15 @@
index :tag_id, {:unique=>true}
end
with_timestamps
one_to_many :networks
+
+ def validate
+
+ unless 1 <= self.tag_id.to_i && self.tag_id.to_i <= 4095
+ errors.add(:tag_id, "Tag ID is out of range (1-4095)")
+ end
+
+ end
end
end