0
嗨在我的rails应用程序我使用devise和omniauth。在我有每当我使用Twitter,Facebook和LinkedIn认证一些奇怪的问题,同时任何一个正常工作另外一个是,如果这样的measn LinkedIn给这个错误设计omniauth数据库约束错误
SQLite3::ConstraintException: UNIQUE constraint failed: users.email: INSERT INTO "users" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?)
在用户mdoel
def self.from_omniauth(auth)
where(auth.slice(:provider, :uid)).first_or_create do |user|
user.provider =auth.provider
user.uid=auth.uid
end
end
工作和
def self.from_omniauth(auth)
where(auth.slice(:provider, :uid)).first_or_create do |user|
user.provider =auth.provider
user.uid=auth.uid
user.email=auth.info.email
end
end
如果像这样意味着微博正在工作,否则所有给出相同的错误我该怎么办?