Remove validation for a property


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

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

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

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.



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs