-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
comments on profile page fixed #2197
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -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 | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, does this have to do with the comment changes? What was the issue? I wasn't sure There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @jywarren. Actually I haven't removed counter_cache but 'dependent: :destroy'. Line 9 in b978d2b
Please correct me if I am wrong! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @jywarren , The tests are written. Please have a look |
||||
# dependent: :destroy, counter_cache: true | ||||
belongs_to :drupal_user, foreign_key: 'uid' | ||||
belongs_to :answer, foreign_key: 'aid' | ||||
|
||||
|
@@ -67,7 +67,7 @@ def parent | |||
if aid == 0 | ||||
node | ||||
else | ||||
answer.node | ||||
return answer.node unless answer.nil? | ||||
end | ||||
end | ||||
|
||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
destroy method triggers dependent: :destroy callback, hence, delete was changed to destroy here.