mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-11 18:21:04 +08:00
10 lines
357 B
Ruby
10 lines
357 B
Ruby
class UserMyModule < ApplicationRecord
|
|
validates :user, :my_module, presence: true
|
|
|
|
belongs_to :user, inverse_of: :user_my_modules, optional: true
|
|
belongs_to :assigned_by,
|
|
foreign_key: 'assigned_by_id',
|
|
class_name: 'User',
|
|
optional: true
|
|
belongs_to :my_module, inverse_of: :user_my_modules, optional: true
|
|
end
|