mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-13 12:47:11 +08:00
9 lines
359 B
Ruby
9 lines
359 B
Ruby
|
class ProtocolKeyword < ActiveRecord::Base
|
||
|
validates :name, presence: true, length: { maximum: 50 }
|
||
|
validates :organization, presence: true
|
||
|
|
||
|
belongs_to :organization, inverse_of: :protocol_keywords
|
||
|
|
||
|
has_many :protocol_protocol_keywords, inverse_of: :protocol_keyword, dependent: :destroy
|
||
|
has_many :protocols, through: :protocol_protocol_keywords
|
||
|
end
|