chore: General fixes and clean up (#1169)

This commit is contained in:
Sojan Jose
2020-08-25 23:04:02 +05:30
committed by GitHub
parent 124e43b477
commit 2193de9853
23 changed files with 111 additions and 121 deletions

View File

@@ -24,8 +24,6 @@
#
class AccountUser < ApplicationRecord
include Events::Types
belongs_to :account
belongs_to :user
belongs_to :inviter, class_name: 'User', optional: true
@@ -33,7 +31,7 @@ class AccountUser < ApplicationRecord
enum role: { agent: 0, administrator: 1 }
accepts_nested_attributes_for :account
after_create :notify_creation, :create_notification_setting
after_create_commit :notify_creation, :create_notification_setting
after_destroy :notify_deletion, :destroy_notification_setting
validates :user_id, uniqueness: { scope: :account_id }