[RUBY] 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+\-.]+@[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
Error in rails db: migrate
rails db: migrate failed!
[Rails] What to do when the error No database selected and Unknown database appears in db: migrate