Sha256: d07bae2fd1615025936fc580d09559009e314dbbda8995b1d055e0ec81ff3a2a
Contents?: true
Size: 665 Bytes
Versions: 4
Compression:
Stored size: 665 Bytes
Contents
module Judge class ConfirmationValidator include Judge::EachValidator attr_reader :object, :method, :amv def initialize(object, method) @object = object @method = method @amv = amv_from_original end def kind @amv.kind if @amv.present? end def options @amv.options if @amv.present? end private def amv_from_original original_amv = nil original_method = method.to_s.gsub('_confirmation', '').to_sym object.class.validators_on(original_method).each do |v| original_amv = v if v.class.name['ConfirmationValidator'] end original_amv end end end
Version data entries
4 entries across 4 versions & 1 rubygems