Remove unnecessary code
This commit is contained in:
parent
02bd924e6a
commit
ecedae273e
|
@ -45,6 +45,10 @@ Rails:
|
|||
Rails/BulkChangeTable:
|
||||
Enabled: false
|
||||
|
||||
Rails/HasAndBelongsToMany:
|
||||
Exclude:
|
||||
- 'app/models/role.rb'
|
||||
|
||||
Rails/LexicallyScopedActionFilter:
|
||||
Exclude:
|
||||
- 'app/controllers/application_controller.rb'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Account < ApplicationRecord
|
||||
rolify role_join_table_name: 'account_roles'
|
||||
rolify role_join_table_name: :account_roles
|
||||
|
||||
has_one :user, dependent: :restrict_with_exception
|
||||
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AccountRole < ApplicationRecord
|
||||
belongs_to :account
|
||||
belongs_to :role
|
||||
end
|
|
@ -1,9 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Role < ApplicationRecord
|
||||
has_many :account_roles, dependent: :destroy
|
||||
|
||||
has_many :accounts, through: :account_roles, source: :account
|
||||
has_and_belongs_to_many :accounts, join_table: :account_roles
|
||||
|
||||
belongs_to :resource, polymorphic: true, optional: true
|
||||
|
||||
|
|
Reference in New Issue