mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-27 01:05:21 +08:00
Added :inverse_of reference for all specific comment models. [fixes SCI-1207]
This commit is contained in:
parent
a0b5a94d67
commit
314e8fcbd2
4 changed files with 5 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
|||
class ProjectComment < Comment
|
||||
belongs_to :project, foreign_key: :associated_id
|
||||
belongs_to :project, foreign_key: :associated_id,
|
||||
inverse_of: :project_comments
|
||||
|
||||
validates :project, presence: true
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class ResultComment < Comment
|
||||
belongs_to :result, foreign_key: :associated_id
|
||||
belongs_to :result, foreign_key: :associated_id, inverse_of: :result_comments
|
||||
|
||||
validates :result, presence: true
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class StepComment < Comment
|
||||
belongs_to :step, foreign_key: :associated_id
|
||||
belongs_to :step, foreign_key: :associated_id, inverse_of: :step_comments
|
||||
|
||||
validates :step, presence: true
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class TaskComment < Comment
|
||||
belongs_to :my_module, foreign_key: :associated_id
|
||||
belongs_to :my_module, foreign_key: :associated_id, inverse_of: :task_comments
|
||||
|
||||
validates :my_module, presence: true
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue