#472 ✓resolved
ronin-26610 (at lighthouseapp)

:message option for property declaration

Reported by ronin-26610 (at lighthouseapp) | July 19th, 2008 @ 04:47 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 Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

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

People watching this ticket

Pages