Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Using validate_uniqueness_of on a translated attribute fails

#2

When validating the uniqueness of a translated attributes it fails with :

You have a nil object when you didn't expect it!
The error occurred while evaluating nil.text?

It actually makes the same kind of error if testing it with rspec 1.1.12 and rspec-on-rails-matchers :

Test :

it { should validate_uniqueness_of(:url) }

Error :

undefined method stub!' for #<Class:0x23b255c> /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1833:inmethod_missing'

Hope that can help improving the fantastic Globalize2 !

Reported by Sébastien Grosjean - ZenCocoon · January 15th, 2009 @ 11:40 AM

State: new
Milestone: none
Assigned to: nobody

Activity

  1. cantorrodista (at gmail)
    cantorrodista (at gmail)

    I reproduced the same problem in my project.

    I think that the problem is in AR::Base method 'columns', that doesn´t found a column named with the attribute (the attribute is in other table, named model_translates)...

    Are there any solutions to fix it??

    I tried to rewrite the columns method, to return also the columns of the table named '*_translates', but other problems came...

    January 26th, 2009 @ 07:07 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.