Module: DeviseGoogleAuthenticator::Schema
- Included in:
- Orm::ActiveRecord::Schema
- Defined in:
- lib/devise_google_authenticatable/schema.rb
Overview
add schema helper for migrations
Instance Method Summary collapse
- #gauth_enabled ⇒ Object
-
#gauth_secret ⇒ Object
Add gauth_secret columns in the resource’s database tables.
- #gauth_tmp ⇒ Object
- #gauth_tmp_datetime ⇒ Object
Instance Method Details
#gauth_enabled ⇒ Object
25 26 27 |
# File 'lib/devise_google_authenticatable/schema.rb', line 25 def gauth_enabled apply_devise_schema :gauth_enabled, Integer, {:default => 0} end |
#gauth_secret ⇒ Object
Add gauth_secret columns in the resource’s database tables
Examples
# For a new resource migration: create_table :the_resources do |t|
t.gauth_secret
t.gauth_enabled
… end
# or if the resource’s table already exists, define a migration and put this in: change_table :the_resources do |t|
t.string :gauth_secret
t.boolean :gauth_enabled
end
21 22 23 |
# File 'lib/devise_google_authenticatable/schema.rb', line 21 def gauth_secret apply_devise_schema :gauth_secret, String end |
#gauth_tmp ⇒ Object
29 30 31 |
# File 'lib/devise_google_authenticatable/schema.rb', line 29 def gauth_tmp apply_devise_schema :gauth_tmp, String end |
#gauth_tmp_datetime ⇒ Object
33 34 35 |
# File 'lib/devise_google_authenticatable/schema.rb', line 33 def gauth_tmp_datetime apply_devise_schema :gauth_tmp_datetime, Datetime end |