Missing translation for activerecord error: taken (uniqueness)

Hi!

I am using Rails3.0.0.rc and get an error which do not occur on
Rails2.3.5

In my model I have:

validates :title, :presence => true, :uniqueness => true

when I start up the console and enter:

x=Blog.new
x.valid? --> false
x.errors --> OrderedHash{:title => [“can’t be blank”]}
x.title=“an_existing_title”
x.valid? --> false
x.errors --> OrderedHash{:title=> [“translation missing: en,
activerecord, errors, models, blog, attributes, title, taken”]}

In Rails2.3.5 this error does not occur. (“title has already been
taken”)

Is this an i18n error or is this a rails3.0.0.rc error?

Sorry for blaming I18n or Rails, it was a very strange error caused by
another gem.

http://github.com/joekhoobyar/composite_primary_keys/blob/master/lib/composite_primary_keys/validations/uniqueness.rb
( record.errors.add(attribute, :taken, :value => value) solves that
issue )

SOLVED :slight_smile:

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