🚨Fix Rubocop lint errors
This commit is contained in:
@@ -4,15 +4,15 @@ class User < ApplicationRecord
|
||||
include Events::Types
|
||||
include Pubsubable
|
||||
|
||||
devise :database_authenticatable,
|
||||
:registerable,
|
||||
:recoverable,
|
||||
:rememberable,
|
||||
:trackable,
|
||||
:validatable,
|
||||
:confirmable
|
||||
devise :database_authenticatable,
|
||||
:registerable,
|
||||
:recoverable,
|
||||
:rememberable,
|
||||
:trackable,
|
||||
:validatable,
|
||||
:confirmable
|
||||
|
||||
#Used by the pusher/PubSub Service we use for real time communications
|
||||
# Used by the pusher/PubSub Service we use for real time communications
|
||||
has_secure_token :pubsub_token
|
||||
|
||||
validates_uniqueness_of :email, scope: :account_id
|
||||
@@ -20,12 +20,12 @@ class User < ApplicationRecord
|
||||
validates :name, presence: true
|
||||
validates :account_id, presence: true
|
||||
|
||||
enum role: [ :agent, :administrator ]
|
||||
enum role: [:agent, :administrator]
|
||||
|
||||
belongs_to :account
|
||||
belongs_to :inviter, class_name: 'User', required: false
|
||||
|
||||
has_many :assigned_conversations, foreign_key: "assignee_id", class_name: "Conversation", dependent: :nullify
|
||||
has_many :assigned_conversations, foreign_key: 'assignee_id', class_name: 'Conversation', dependent: :nullify
|
||||
has_many :inbox_members, dependent: :destroy
|
||||
has_many :assigned_inboxes, through: :inbox_members, source: :inbox
|
||||
has_many :messages
|
||||
@@ -38,19 +38,19 @@ class User < ApplicationRecord
|
||||
after_destroy :notify_deletion
|
||||
|
||||
def set_password_and_uid
|
||||
self.uid = self.email
|
||||
self.uid = email
|
||||
end
|
||||
|
||||
def serializable_hash(options = nil)
|
||||
super(options).merge(confirmed: confirmed?, subscription: account.try(:subscription).try(:summary) )
|
||||
super(options).merge(confirmed: confirmed?, subscription: account.try(:subscription).try(:summary))
|
||||
end
|
||||
|
||||
def notify_creation
|
||||
Rails.configuration.dispatcher.dispatch(AGENT_ADDED, Time.zone.now, account: self.account)
|
||||
Rails.configuration.dispatcher.dispatch(AGENT_ADDED, Time.zone.now, account: account)
|
||||
end
|
||||
|
||||
def notify_deletion
|
||||
Rails.configuration.dispatcher.dispatch(AGENT_REMOVED, Time.zone.now, account: self.account)
|
||||
Rails.configuration.dispatcher.dispatch(AGENT_REMOVED, Time.zone.now, account: account)
|
||||
end
|
||||
|
||||
def push_event_data
|
||||
|
||||
Reference in New Issue
Block a user