Skip to content
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

[#153876] Fix error when viewing logs for account price groups #2360

Merged

Conversation

giladshanan
Copy link
Collaborator

@giladshanan giladshanan commented Jul 29, 2020

Release Notes

I think this has actually been broken since #2302.

Run rake cleanup:log_events:metadata after merging

@giladshanan giladshanan requested a review from a team as a code owner July 29, 2020 18:27
@giladshanan giladshanan requested a review from jhanggi July 29, 2020 18:27
Copy link
Contributor

@jhanggi jhanggi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only thought to check this because I happened to check the original PR: if you add or remove an account from a price group, it's still appearing as "User added to price group" for the event.

I'm not sure how easy it will be to make this distinction based on subclass. (I'm worried if we did subclasses, then things like the Account subclasses might cause problems here). We could also try something like passing in some interpolation value, "%{object} added to price group".

I'm not sure what the best solution is, but if it's too difficult, maybe we can change it to "Price group member added" or "Member added to price group".

@giladshanan giladshanan requested a review from jhanggi July 30, 2020 22:16
namespace :log_events do
desc "update metadata for PriceGroupMembers"
task metadata: :environment do
events = LogEvent.where("loggable_type LIKE ?", "PriceGroupMember").where(metadata: nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just loggable_type: "PriceGroupMember"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started out thinking there were loggable types for the subclasses, and forgot to update. Good catch.

app/controllers/concerns/price_group_members_controller.rb Outdated Show resolved Hide resolved
app/controllers/concerns/price_group_members_controller.rb Outdated Show resolved Hide resolved
lib/tasks/cleanup.rake Outdated Show resolved Hide resolved
@giladshanan giladshanan merged commit a57d2d9 into master Jul 31, 2020
@giladshanan giladshanan deleted the 153876-fix-error-when-logging-account-price-groups branch July 31, 2020 19:40
@jhanggi jhanggi added the NU label Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants