2018-05-07 16:47:29 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2021-02-20 09:57:27 -08:00
|
|
|
# == Schema Information
|
|
|
|
|
#
|
|
|
|
|
# Table name: users_roles
|
|
|
|
|
#
|
|
|
|
|
# id :bigint not null, primary key
|
|
|
|
|
# role_id :integer
|
|
|
|
|
# user_id :integer
|
|
|
|
|
#
|
|
|
|
|
# Indexes
|
|
|
|
|
#
|
|
|
|
|
# index_users_roles_on_user_id_and_role_id (user_id,role_id)
|
|
|
|
|
#
|
2017-09-05 22:23:34 +03:00
|
|
|
class UsersRole < ApplicationRecord
|
2016-05-24 23:54:46 +05:30
|
|
|
belongs_to :role
|
|
|
|
|
belongs_to :user
|
|
|
|
|
|
2020-04-03 09:51:35 -07:00
|
|
|
delegate :conference_id, :organization_id, to: :role
|
2016-05-24 23:54:46 +05:30
|
|
|
|
2020-04-03 09:51:35 -07:00
|
|
|
has_paper_trail on: [:create, :destroy],
|
|
|
|
|
meta: { conference_id: :conference_id, organization_id: :organization_id }
|
2016-05-24 23:54:46 +05:30
|
|
|
end
|