Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Move the taken validation message? #136

rurounijones opened this Issue · 10 comments

3 participants


Current the "taken" validation message (used by validates_uniqueness_of) is in the activerecord section of the yml files.

However I think this should be moved into the general "errors" section above its current location since it is also used by other non-activerecord ORMs / ODMs (Mongoid comes to mind) so having it in activerecord section is misleading.

I know some people delete the whole activerecord section since they are using mongoid and believe those translations are specific to activerecord only (Not generally in activemodel).


It seems that mongoid defines taken in its own .yml file as well but I cannot see any reason why it should need to, is this because of the fact that taken wasn't in the general list originally?


I agree with you, rurounijones.

Should we move record_invalid to the errors section, too?
I don't know whether other ORMs/ODMs use this keyword, but our translation files will get simpler by doing this.


I had a look at the other keys but I am honestly not sure where they are used, my thought was that maybe they are used only in the default scaffold error pages but that doesn't seem to be the case.

Looking at the mongoid.yml file they have a "validations" key which seems to serve the same purpose as record_invalid. Again maybe because the default "record_invalid" key was in the activerecord section so they thought they needed their own equivalent.

Personally I don't think it would cause any trouble to move record_invalid as well but I cannot be sure.


Have a look at lib/active_record/validations.rb of ActiveRecord 3.1.0.

This key is used for the message of ActiveRecord::RecordInvalid exception, which is raised when we call save! method on an invalid record object.


Rurounijones, could you make necessary modifications and send a pull request?

If you have a time to do that, I will do it in my spare time.

But, in that case, please wait for a while! Unfortunately, I am busy a little bit now.


I will see if I can do it next monday.



I will make a new gem and publish it immediately.


Sorry for the delay; got sidetracked and just remembered this issue (God bless github's new dashboard issues feature). Will get on it when I can.


Moving these keys makes sense I think.

The :taken message is used in the uniqueness validation BTW.

I can work on getting this fixed up for some of the locales - but my language skills won't be good enough for all of them! :)


tigrish, make a pull request onto the restructuring branch, please.

@tigrish tigrish referenced this issue

Yaml cleanup #162

@kuroda kuroda closed this issue from a commit
@tigrish tigrish Moved :'activerecord.errors.messages.taken' and :'activerecord.errors…
….messages.record_invalid' into the :'errors.messages' scope

Closes #136
@kuroda kuroda closed this in 988879e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.