Add dependant: :destroy to comments

This commit is contained in:
Luka Murn 2016-08-24 14:00:30 +02:00
parent 8a73a3ab5c
commit 9e3bb8edb7

View file

@ -11,11 +11,11 @@ class Comment < ActiveRecord::Base
belongs_to :user, inverse_of: :comments
belongs_to :last_modified_by, foreign_key: 'last_modified_by_id', class_name: 'User'
has_one :step_comment, inverse_of: :comment
has_one :my_module_comment, inverse_of: :comment
has_one :result_comment, inverse_of: :comment
has_one :sample_comment, inverse_of: :comment
has_one :project_comment, inverse_of: :comment
has_one :step_comment, inverse_of: :comment, dependent: :destroy
has_one :my_module_comment, inverse_of: :comment, dependent: :destroy
has_one :result_comment, inverse_of: :comment, dependent: :destroy
has_one :sample_comment, inverse_of: :comment, dependent: :destroy
has_one :project_comment, inverse_of: :comment, dependent: :destroy
def self.search(
user,