Yeah, i saw the default messages, but i dont really want to change
original gem.

Also, i noticed that custom validation errors does not work.

Example:

class User
   include DataMapper::Resource

   property :id, Serial
   property :name, String
   property :email, String, :length => 6..64, :format
=> :email_address
end

u = User.new(:name => 'My name', :email => '[email protected]')
if u.valid?
   u.errors.add(:name, 'Invalid name')
   puts "Valid: #{u.valid?}"
end

Or maybe im just doing it wrong. Ideas?

On Jun 21, 9:13 am, Ripta Pasay <[email protected]> wrote:
> AFAIK, there isn't an option to disable column names from being
> included.
>
> Instead, I do what you describe: change the default validation
> messages
> (DataMapper::Validations::ValidationErrors.default_error_messages=).
> Unfortunately, this also means I had to monkey-patch
> DM::V::VE.default_error_message so that it doesn't interpolate the
> field name.
>
> -Ripta
>
> On Jun 16, 8:47 pm, Dan Sosedov <[email protected]> wrote:
>
> > Oh, and i forgot to add, this can be done with custom validation
> > messages.
>
> > But the question still the same: is it possible to make this
> > conversions automatically?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to