Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
ven-job
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Trịnh Hoàng Phúc
ven-job
Commits
3a793667
Commit
3a793667
authored
Apr 22, 2020
by
Hoang Phuc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Devise Admin
parent
da165766
Pipeline
#582
failed with stages
in 0 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
1 deletions
+66
-1
app/models/admin.rb
+6
-0
config/routes.rb
+1
-0
db/migrate/20200417033927_devise_create_admins.rb
+44
-0
db/schema.rb
+15
-1
No files found.
app/models/admin.rb
0 → 100644
View file @
3a793667
class
Admin
<
ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise
:database_authenticatable
,
:registerable
,
:recoverable
,
:rememberable
,
:validatable
end
config/routes.rb
View file @
3a793667
Rails
.
application
.
routes
.
draw
do
devise_for
:admins
devise_for
:users
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
root
to:
'home#index'
...
...
db/migrate/20200417033927_devise_create_admins.rb
0 → 100644
View file @
3a793667
# frozen_string_literal: true
class
DeviseCreateAdmins
<
ActiveRecord
::
Migration
[
6.0
]
def
change
create_table
:admins
do
|
t
|
## Database authenticatable
t
.
string
:email
,
null:
false
,
default:
""
t
.
string
:encrypted_password
,
null:
false
,
default:
""
## Recoverable
t
.
string
:reset_password_token
t
.
datetime
:reset_password_sent_at
## Rememberable
t
.
datetime
:remember_created_at
## Trackable
# t.integer :sign_in_count, default: 0, null: false
# t.datetime :current_sign_in_at
# t.datetime :last_sign_in_at
# t.string :current_sign_in_ip
# t.string :last_sign_in_ip
## Confirmable
# t.string :confirmation_token
# t.datetime :confirmed_at
# t.datetime :confirmation_sent_at
# t.string :unconfirmed_email # Only if using reconfirmable
## Lockable
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
# t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at
t
.
timestamps
null:
false
end
add_index
:admins
,
:email
,
unique:
true
add_index
:admins
,
:reset_password_token
,
unique:
true
# add_index :admins, :confirmation_token, unique: true
# add_index :admins, :unlock_token, unique: true
end
end
db/schema.rb
View file @
3a793667
...
...
@@ -10,7 +10,19 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2020_04_08_025325
)
do
ActiveRecord
::
Schema
.
define
(
version:
2020_04_17_033927
)
do
create_table
"admins"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"
,
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
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"email"
],
name:
"index_admins_on_email"
,
unique:
true
t
.
index
[
"reset_password_token"
],
name:
"index_admins_on_reset_password_token"
,
unique:
true
end
create_table
"applies"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"
,
force: :cascade
do
|
t
|
t
.
bigint
"user_id"
,
null:
false
...
...
@@ -87,6 +99,8 @@ ActiveRecord::Schema.define(version: 2020_04_08_025325) do
t
.
datetime
"remember_created_at"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
string
"full_name"
t
.
string
"cv"
t
.
index
[
"email"
],
name:
"index_users_on_email"
,
unique:
true
t
.
index
[
"reset_password_token"
],
name:
"index_users_on_reset_password_token"
,
unique:
true
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment