Rails: NameError (uninitialized constant ActiveRecord :: RecordNotUnique)

I have a problem with my rails application. I get the following error:

NameError (uninitialized constant ActiveRecord::RecordNotUnique)

I'm not sure why this is the way it works in my development environment. The exception is checked:

    begin
      ...
    rescue ActiveRecord::RecordNotUnique
      next
    end

Lg markus

+3
source share
1 answer

When you see this problem, i.e. test, production?

What version of ActiveRecord do you have in this environment?

Update:

As far as I know, ActiveRecord :: RecordNotUnique became available in version 3.0.0 and later apidock.com/rails/ActiveRecord/RecordNotUnique You need to have this version or more to use this database exception.

+2
source

All Articles