Project

General

Profile

Bug #12728

Report should have host_id, reported_at, status and metrics attr_accessible

Added by Shlomi Zadok over 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

In report model we should add attr_accessible :host_id, :reported_at, :status, :metrics to support children who assign those values.


Related issues

Related to Foreman - Bug #7568: Use attr_accessible for rails 4 upgradeClosed2014-09-22

Associated revisions

Revision 104468b2 (diff)
Added by Shlomi Zadok over 3 years ago

Fixes #12728 - Add attr_accessible to Report

History

#1 Updated by Dominic Cleal over 3 years ago

  • Related to Bug #7568: Use attr_accessible for rails 4 upgrade added

#2 Updated by Dominic Cleal over 3 years ago

  • Category set to Rails

The report importers don't use mass-assignment at the moment, AFAIK.

#3 Updated by The Foreman Bot over 3 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Shlomi Zadok
  • Pull request https://github.com/theforeman/foreman/pull/2961 added

#4 Updated by Shlomi Zadok over 3 years ago

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

#5 Updated by Dominic Cleal over 3 years ago

  • Legacy Backlogs Release (now unused) set to 71

Due to using Taxonomix in the ArfReport model, it makes the model protected.

#6 Updated by Shlomi Zadok over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF