1
0
Fork 0

Remove unnecessary code

This commit is contained in:
Alex Kotov 2018-12-06 06:22:39 +05:00
parent 02bd924e6a
commit ecedae273e
No known key found for this signature in database
GPG Key ID: 4E831250F47DE154
4 changed files with 6 additions and 10 deletions

View File

@ -45,6 +45,10 @@ Rails:
Rails/BulkChangeTable:
Enabled: false
Rails/HasAndBelongsToMany:
Exclude:
- 'app/models/role.rb'
Rails/LexicallyScopedActionFilter:
Exclude:
- 'app/controllers/application_controller.rb'

View File

@ -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

View File

@ -1,6 +0,0 @@
# frozen_string_literal: true
class AccountRole < ApplicationRecord
belongs_to :account
belongs_to :role
end

View File

@ -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