ArgumentError: Unknown validator:'UniqunessValidator' in rake db: migrate

Under development at sinatra With reke db: migrate ╩╗ArgumentError: Unknown validator: Cause and action when'UniqunessValidator'` appears

solution

uniqnessvlidator? I don't know that! I'm writing something like that I once erased the validation I wrote earlier on the corresponding model!

user.rb


class User < ActiveRecord::Base
#  validates :email, presence: true, length: {maximum: 255 },
#    format: { with: /\A[\w+\-.][email protected][a-z\d\-.]+\.[a-z]+\z/i },
#    uniquness: { case_sensitive: false }
#  has_secure_password
end

Now run rake db: migrate and it's migrated!

If you look closely, ...

The uniqueness e is missing! !! !!

user.rb



    uniquness: { case_sensitive: false }

Be careful of typos ...

Recommended Posts

ArgumentError: Unknown validator:'UniqunessValidator' in rake db: migrate
rails db: migrate failed!
[Rails] What to do when the error No database selected and Unknown database appears in db: migrate