Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add save hooks on MiqReportResult to remove groupings
https://bugzilla.redhat.com/show_bug.cgi?id=1590908 The `report.extras[:groupings]` on MiqReportResult were being serialized to the `report` column, and on certain chargeback reports, can get quite large. This data is not needed, so we remove it prior to saving. The `after_commit` exists in case there is a use for the saved data after it has been saved and still used within the original instance of the MiqReportResult for building the result. Most likely this is overkill, but for now it is in place as a safety measure. Also, `after_commit` is used because a `after_save` will cause an "stack level too deep" error since editing the report value causes the record to be put into a `dirty` state, and the ActiveRecord internals don't like that.
- Loading branch information