English 中文(简体)
Rails3 Devise身份验证迁移
原标题:Rails3 Devise authentication Migration

我一直在考虑如何最好地让我的新应用程序在数据库中表示users表。

我注意到一个迁移名如下:

20110512234640_devise_create_users.rb

这是Device在安装时创建的东西吗?或者,我可以使用一个更简单的用户表迁移吗?

人们通常如何配置Devise,并且仍然能够在用户表中添加他们的特定应用程序可能需要的额外列?

Thanks, Alex

最佳回答

通常,您可以在更多的迁移中创建,将自己的字段添加到Devise使用的表中(这是为了保持设计迁移的清晰和简单)

问题回答

你是对的,这是Devise自动生成的迁移,它允许你更容易地选择你的Devise模块,因为默认模块被添加到迁移中,其他模块也在那里,但有评论。

当然,您可以使用手工编写的用户迁移。

就我个人而言,我使用生成的迁移来添加我自己的额外字段。但是使用自定义用户迁移文件是一样的。





相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Remotely authenticating client Windows user on demand

Suppose I am writing a server for a particular network protocol. If I know that the client is running on a Windows machine, is it possible for my server to authenticate the Windows user that owns the ...

Role/Permission based forms authorizing/authentication?

While looking into forms authorizing/authentication, I found that it is possible to do role based authorizing by adding an array of roles to a FormsAuthenticationTicket. That way I can write User....

热门标签