Markus
Markus

Reputation: 4038

Rails: NameError (uninitialized constant ActiveRecord::RecordNotUnique)

I have a problem with my rails app. I get the following Error:

NameError (uninitialized constant ActiveRecord::RecordNotUnique)

Im not sure why this is as it works on my development environment. The exception gets tested by:

    begin
      ...
    rescue ActiveRecord::RecordNotUnique
      next
    end

Lg Markus

Upvotes: 3

Views: 1828

Answers (1)

charliequinn
charliequinn

Reputation: 430

When are you seeing this problem i.e. test, production?

What version of ActiveRecord do you have on this environment?

Update:

As far as I am aware ActiveRecord::RecordNotUnique became available in version 3.0.0 onwards apidock.com/rails/ActiveRecord/RecordNotUnique You need to have this version or greater to use this database exception.

Upvotes: 2

Related Questions