-
Notifications
You must be signed in to change notification settings - Fork 313
Bug delete user #398 #236
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
Bug delete user #398 #236
Conversation
ossum. |
has_many :likes | ||
has_many :comments, dependent: :delete_all | ||
|
||
has_one :github_profile , class_name: 'Users::Github::Profile', dependent: :destroy | ||
has_many :github_repositories, through: :github_profile , source: :repositories | ||
|
||
after_validation :geocode_location, if: :location_changed? unless Rails.env.test? |
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.
From my experience it can lead to a hard debuggable issues.
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.
It fine he just moved it from below. we should however remove it.
@YaroSpace , could you add a comment on top of that line # FIXME: Move to background job
@@ -31,5 +33,9 @@ def create_team(name = 'TEST_TEAM') | |||
fill_in 'team_name', with: name | |||
click_button 'Next' | |||
end | |||
|
|||
def save_screenshot(path = 'tmp/screenshot.png', selector = 'body') |
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.
Why did you extract such helper? Doesn't save_screenshot
work already?
Documentation states that it is declared on Session
and therefore seems to be available. Did you encounter any issue using it?
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.
save_screenshot
is capybara's internal command, it saves the screenshot/page without any assets, i.e images. The helper save_screenshot
is using Proltergeist's internal command, which makes a proper screenshot from within the browser. However, the choice of the method name was silly, as it overrides the original command. Will fix that. Thanks.
Bounty: BUG: After deleting a user/protip Coderwall will generate a 404 on the logged in home
Simple fix, but took ages to figure out.
For some reason (please somebody tell me why)
has_many :protips, dependent: delete_all
deletes all protips associated with a user, but does not triggerafter_destroy
or any other callbacks ofProtip
.(hence does not update the ES index, deleted Protip's ids get returned in search results....eventually that causes
ActiveRecord::NoRecordFound
and 404)I have tried
dependent: :destroy, destroy_all
- no effect, so just added abefore_destroy
callback for the User model.