sanger/sequencescape

View on GitHub
app/models/role/user_role.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

# Simple join table of {Role roles} to {User users}
class Role::UserRole < ApplicationRecord
  self.table_name = 'roles_users'

  belongs_to :role, touch: true
  belongs_to :user

  after_destroy :touch_authorizable

  delegate :touch_authorizable, :authorizable, to: :role
end