mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
Added devise migartions
This commit is contained in:
parent
61cbc38a11
commit
db4727b8f7
4 changed files with 38 additions and 15 deletions
|
@ -8,6 +8,8 @@ class AdminUser < User
|
||||||
|
|
||||||
ROLES = %w(user customer_service admin)
|
ROLES = %w(user customer_service admin)
|
||||||
|
|
||||||
|
devise :database_authenticatable, :rememberable, :trackable, :validatable, :lockable
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
username
|
username
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
= err
|
= err
|
||||||
%br
|
%br
|
||||||
.row
|
.row
|
||||||
.col-md-6
|
.col-md-8
|
||||||
.panel.panel-default
|
.panel.panel-default
|
||||||
.panel-heading
|
.panel-heading
|
||||||
%h3.panel-title= t(:general)
|
%h3.panel-title= t(:general)
|
||||||
|
@ -18,21 +18,12 @@
|
||||||
%dt= t(:username)
|
%dt= t(:username)
|
||||||
%dd= @admin_user.username
|
%dd= @admin_user.username
|
||||||
|
|
||||||
%dt= t(:password)
|
%dt= t(:email)
|
||||||
%dd= @admin_user.password
|
%dd= @admin_user.email
|
||||||
|
|
||||||
%dt= t(:identity_code)
|
%dt= t(:identity_code)
|
||||||
%dd= @admin_user.identity_code
|
%dd= @admin_user.identity_code
|
||||||
|
|
||||||
.col-md-6
|
|
||||||
.panel.panel-default
|
|
||||||
.panel-heading
|
|
||||||
%h3.panel-title= t(:address)
|
|
||||||
.panel-body
|
|
||||||
%dl.dl-horizontal
|
|
||||||
%dt= t(:email)
|
|
||||||
%dd= @admin_user.email
|
|
||||||
|
|
||||||
%dt= t(:role)
|
%dt= t(:role)
|
||||||
- if @admin_user.roles
|
- if @admin_user.roles
|
||||||
%dd= t(@admin_user.roles.first)
|
%dd= t(@admin_user.roles.first)
|
||||||
|
|
8
db/migrate/20150519144118_add_devise_attributes.rb
Normal file
8
db/migrate/20150519144118_add_devise_attributes.rb
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
class AddDeviseAttributes < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :users, :encrypted_password, :string, null: true, default: ""
|
||||||
|
add_column :users, :remember_created_at, :datetime, null: true
|
||||||
|
add_column :users, :failed_attempts, :integer, default: 0, null: false
|
||||||
|
add_column :users, :locked_at, :datetime, null: true
|
||||||
|
end
|
||||||
|
end
|
28
db/schema.rb
28
db/schema.rb
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20150519102521) do
|
ActiveRecord::Schema.define(version: 20150519144118) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
@ -840,6 +840,24 @@ ActiveRecord::Schema.define(version: 20150519102521) do
|
||||||
|
|
||||||
add_index "nameservers", ["domain_id"], name: "index_nameservers_on_domain_id", using: :btree
|
add_index "nameservers", ["domain_id"], name: "index_nameservers_on_domain_id", using: :btree
|
||||||
|
|
||||||
|
create_table "people", force: :cascade do |t|
|
||||||
|
t.string "email", default: "", null: false
|
||||||
|
t.string "encrypted_password", default: "", null: false
|
||||||
|
t.string "reset_password_token"
|
||||||
|
t.datetime "reset_password_sent_at"
|
||||||
|
t.datetime "remember_created_at"
|
||||||
|
t.integer "sign_in_count", default: 0, null: false
|
||||||
|
t.datetime "current_sign_in_at"
|
||||||
|
t.datetime "last_sign_in_at"
|
||||||
|
t.inet "current_sign_in_ip"
|
||||||
|
t.inet "last_sign_in_ip"
|
||||||
|
t.datetime "created_at"
|
||||||
|
t.datetime "updated_at"
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index "people", ["email"], name: "index_people_on_email", unique: true, using: :btree
|
||||||
|
add_index "people", ["reset_password_token"], name: "index_people_on_reset_password_token", unique: true, using: :btree
|
||||||
|
|
||||||
create_table "registrant_verifications", force: :cascade do |t|
|
create_table "registrant_verifications", force: :cascade do |t|
|
||||||
t.string "domain_name"
|
t.string "domain_name"
|
||||||
t.string "verification_token"
|
t.string "verification_token"
|
||||||
|
@ -907,13 +925,13 @@ ActiveRecord::Schema.define(version: 20150519102521) do
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.string "email"
|
t.string "email"
|
||||||
t.integer "sign_in_count", default: 0, null: false
|
t.integer "sign_in_count", default: 0, null: false
|
||||||
t.datetime "current_sign_in_at"
|
t.datetime "current_sign_in_at"
|
||||||
t.datetime "last_sign_in_at"
|
t.datetime "last_sign_in_at"
|
||||||
t.inet "current_sign_in_ip"
|
t.inet "current_sign_in_ip"
|
||||||
t.inet "last_sign_in_ip"
|
t.inet "last_sign_in_ip"
|
||||||
t.string "identity_code"
|
t.string "identity_code"
|
||||||
t.string "roles", array: true
|
t.string "roles", array: true
|
||||||
t.string "creator_str"
|
t.string "creator_str"
|
||||||
t.string "updator_str"
|
t.string "updator_str"
|
||||||
t.string "country_code"
|
t.string "country_code"
|
||||||
|
@ -923,6 +941,10 @@ ActiveRecord::Schema.define(version: 20150519102521) do
|
||||||
t.text "crt"
|
t.text "crt"
|
||||||
t.string "type"
|
t.string "type"
|
||||||
t.string "registrant_ident"
|
t.string "registrant_ident"
|
||||||
|
t.string "encrypted_password", default: ""
|
||||||
|
t.datetime "remember_created_at"
|
||||||
|
t.integer "failed_attempts", default: 0, null: false
|
||||||
|
t.datetime "locked_at"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "users", ["identity_code"], name: "index_users_on_identity_code", using: :btree
|
add_index "users", ["identity_code"], name: "index_users_on_identity_code", using: :btree
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue