mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-16 14:17:00 +08:00
8 lines
270 B
Ruby
8 lines
270 B
Ruby
|
class MyModuleComment < ActiveRecord::Base
|
||
|
validates :comment, :my_module, presence: true
|
||
|
validates :my_module_id, uniqueness: { scope: :comment_id }
|
||
|
|
||
|
belongs_to :comment, inverse_of: :my_module_comment
|
||
|
belongs_to :my_module, inverse_of: :my_module_comments
|
||
|
end
|