Sha256: fdae8626eea98b6ef6de5fd0c7b17ba9c224d4078c94d8fa1416b664cfc24321
Contents?: true
Size: 581 Bytes
Versions: 180
Compression:
Stored size: 581 Bytes
Contents
module Katello module Validators class PriorValidator < ActiveModel::Validator def validate(record) # need to ensure that prior # environment already does not have a successor # this is because in v1.0 we want # prior to have only one child (unless its the Library) ancestor = record.prior if ancestor && !ancestor.library? record.errors[:prior] << _("prior environment can only have one child") if ancestor.successors.count == 1 && !ancestor.successors.include?(record) end end end end end
Version data entries
180 entries across 180 versions & 1 rubygems