Bug #12728
closed
Report should have host_id, reported_at, status and metrics attr_accessible
Added by Shlomi Zadok about 9 years ago.
Updated over 6 years ago.
Description
In report model we should add attr_accessible :host_id, :reported_at, :status, :metrics
to support children who assign those values.
- Related to Bug #7568: Use attr_accessible for rails 4 upgrade added
The report importers don't use mass-assignment at the moment, AFAIK.
- Status changed from New to Ready For Testing
- Assignee set to Shlomi Zadok
- Pull request https://github.com/theforeman/foreman/pull/2961 added
Use case:
In foreman_openscap, we do not use a report importer, the ArfReport has a method which simulates the importer to create the ArfReport.
As you can see, we generate the report directly with ArfReport.create! which yields:
Action failed
ActiveModel::MassAssignmentSecurity::Error: Can't mass-assign protected attributes: host_id, reported_at, status, metrics
- Translation missing: en.field_release set to 71
Due to using Taxonomix in the ArfReport model, it makes the model protected.
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Also available in: Atom
PDF