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: Rails/BulkChangeTable:
Enabled: false Enabled: false
Rails/HasAndBelongsToMany:
Exclude:
- 'app/models/role.rb'
Rails/LexicallyScopedActionFilter: Rails/LexicallyScopedActionFilter:
Exclude: Exclude:
- 'app/controllers/application_controller.rb' - 'app/controllers/application_controller.rb'

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
class Account < ApplicationRecord class Account < ApplicationRecord
rolify role_join_table_name: 'account_roles' rolify role_join_table_name: :account_roles
has_one :user, dependent: :restrict_with_exception 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 # frozen_string_literal: true
class Role < ApplicationRecord class Role < ApplicationRecord
has_many :account_roles, dependent: :destroy has_and_belongs_to_many :accounts, join_table: :account_roles
has_many :accounts, through: :account_roles, source: :account
belongs_to :resource, polymorphic: true, optional: true belongs_to :resource, polymorphic: true, optional: true