add trashable concern on user
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# avatar_url :string
|
||||
# deleted_at :datetime
|
||||
# email :string default(""), not null
|
||||
# encrypted_password :string default(""), not null
|
||||
# name :string not null
|
||||
@@ -20,6 +21,7 @@
|
||||
# index_users_on_reset_password_token (reset_password_token) UNIQUE
|
||||
#
|
||||
class User < ApplicationRecord
|
||||
include Trashable
|
||||
extend Enumerize
|
||||
|
||||
devise :database_authenticatable,
|
||||
@@ -38,7 +40,6 @@ class User < ApplicationRecord
|
||||
|
||||
before_validation :set_random_password, on: :create
|
||||
|
||||
|
||||
roles.values.each do |role|
|
||||
define_method "#{role}?" do
|
||||
roles.include?(role)
|
||||
|
||||
Reference in New Issue
Block a user