-
Notifications
You must be signed in to change notification settings - Fork 19
Model and Resource Setup
lerebear edited this page Feb 14, 2016
·
2 revisions
A resource table should define the following columns:
Column | Type |
---|---|
tokens | text |
uid | string |
provider | string |
A resources columns will be determined by the features that you intend to use for that resource:
Column | Type |
---|---|
string |
|
encrypted_password | string |
Column | Type |
---|---|
reset_password_token | string |
reset_password_sent_at | datetime |
Column | Type |
---|---|
current_sign_in_at | datetime |
last_sign_in_at | datetime |
current_sign_in_ip | string |
last_sign_in_ip | string |
sign_in_count | integer |
Column | Type |
---|---|
confirmation_token | string |
confirmed_at | datetime |
confirmation_sent_at | datetime |
unconfirmed_email | string |
Column | Type |
---|---|
nickname | string |
name | string |
image | string |
In order to setup token authentication on a given ActiveRecord model, include
the ActiveRecord::TokenAuth
module.
class User < ActiveRecord::Base
include GrapeTokenAuth::ActiveRecord::TokenAuth
end