require'dm-validations'moduleDataMappermoduleValidations## This only performs validations if the object being saved is dirty.#defsave_self(*)# # short-circuit if the resource is not dirty#ifdirty_self?&&Validations::Context.any?&&!valid?(model.validators.current_context)falseelsesuperendendendend