mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 03:37:56 +01:00
Add admin panel and make it work for user resource
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
class User < ApplicationRecord
|
||||
devise :database_authenticatable, :registerable,
|
||||
:recoverable, :rememberable, :validatable,
|
||||
:confirmable
|
||||
|
||||
enum role: [:user, :moderator, :admin]
|
||||
after_initialize :set_default_role, if: :new_record?
|
||||
|
||||
@@ -12,8 +16,4 @@ class User < ApplicationRecord
|
||||
gravatar_id = Digest::MD5::hexdigest(email.downcase)
|
||||
"https://secure.gravatar.com/avatar/#{gravatar_id}"
|
||||
end
|
||||
|
||||
devise :database_authenticatable, :registerable,
|
||||
:recoverable, :rememberable, :validatable,
|
||||
:confirmable
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user