Sha256: f21e67f58d286b3944b6f96c2c71b8e1c0026511499f0ae246114d4edd60b5bb
Contents?: true
Size: 601 Bytes
Versions: 10
Compression:
Stored size: 601 Bytes
Contents
require 'action_logic/errors' require 'action_logic/action_validation/base_validation' module ActionLogic module ActionValidation class AttributeValidation < BaseValidation def self.validate!(validation_rules, context) existing_attributes = context.to_h.keys expected_attributes = validation_rules.keys || [] missing_attributes = expected_attributes - existing_attributes raise ActionLogic::MissingAttributeError.new(error_message_format(missing_attributes.join(", ") + " attributes are missing")) if missing_attributes.any? end end end end
Version data entries
10 entries across 10 versions & 1 rubygems