Remove validation for a property


#1

Hi

Does anyone here know a way who I could remove the validation for a
model’s property? For example, I would like to have in one file:

class A < ActiveRecord::Base
validates_uniqueness :title
end

And in another file I want to override or rather remove the validation:

class A < ActiveRecord::Base
# somehow stop validating :title for uniqueness
end

The purpose of this? Well, I could provide a model “A” in a plugin or
component and change its behaviour in my application.

This comes in handy, for example, if you want to provide a default
format for user names (very restrictive, maybe only :alnum:) in your
application, however, you want to allow spaces.

Regards,

Manuel