Sha256: e89e2c40654bfb7a5175b91e1f8399c10579b55fb4a538f4008f935a35021848
Contents?: true
Size: 583 Bytes
Versions: 12
Compression:
Stored size: 583 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? && (ancestor.successors.count == 1 && !ancestor.successors.include?(record)) record.errors[:prior] << _("prior environment can only have one child") end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems