【发布时间】:2012-02-09 03:32:48
【问题描述】:
我已经使用 devise 创建了一个用户模型,但我现在想添加对 token_authenticable 的支持,所以我需要迁移这些添加。以下是否正确,token_authenticable 应该是什么类型?
class AddAuthenticationTokenToUser < ActiveRecord::Migration
def change
add_column :users, :token_authenticatable
add_index :users, :authentication_token, :unique => true
end
end
【问题讨论】:
标签: ruby-on-rails database devise migration token