Use auth token for permanent sessions
parent
3e1feff84e
commit
431fd87002
@ -0,0 +1,6 @@
|
||||
class AddAuthTokenToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :auth_token, :string
|
||||
add_index :users, :auth_token
|
||||
end
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
class SetAuthTokenForExistingUsers < ActiveRecord::Migration
|
||||
def up
|
||||
User.find_each do |user|
|
||||
user.update_attribute(:auth_token, SecureRandom.urlsafe_base64)
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue