Skip to content

Commit

Permalink
comments on profile page fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ViditChitkara committed Feb 2, 2018
1 parent d3391d5 commit 9240091
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/models/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ class Comment < ActiveRecord::Base
:subject, :hostname, :comment,
:status, :format, :thread, :timestamp

belongs_to :node, foreign_key: 'nid', touch: true,
dependent: :destroy, counter_cache: true
belongs_to :node, foreign_key: 'nid', touch: true, counter_cache: true
# dependent: :destroy, counter_cache: true
belongs_to :drupal_user, foreign_key: 'uid'
belongs_to :answer, foreign_key: 'aid'

Expand Down Expand Up @@ -67,7 +67,7 @@ def parent
if aid == 0
node
else
answer.node
answer && answer.node
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def updated_month
has_many :tag, through: :node_tag
# these override the above... have to do it manually:
# has_many :tag, :through => :drupal_node_tag
has_many :comments, foreign_key: 'nid' #, dependent: :destroy # re-enable in Rails 5
has_many :comments, foreign_key: 'nid' , dependent: :destroy # re-enable in Rails 5
has_many :drupal_content_type_map, foreign_key: 'nid' #, dependent: :destroy # re-enable in Rails 5
has_many :drupal_content_field_mappers, foreign_key: 'nid' #, dependent: :destroy # re-enable in Rails 5
has_many :drupal_content_field_map_editor, foreign_key: 'nid' #, dependent: :destroy # re-enable in Rails 5
Expand Down

0 comments on commit 9240091

Please sign in to comment.