#472 √ resolved
ronin-26610 (at lighthouseapp)

:message option for property declaration

Reported by ronin-26610 (at lighthouseapp) | July 19th, 2008 @ 04:45 PM

When using auto validation it`s impossible to specify custom error message. It would allow code like this:

property :title, String, :nullable => false, :message => "Please provide title"

All needed is:

module DataMapper

class Property

PROPERTY_OPTIONS << :message

end

end

and then in DataMapper::Validate::AutoValidate#auto_generate_validations

add line:

opts[:message] = property.options[:message] if property.options.has_key?(:message)

it`s undestructive but very helpful

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket