Project

General

Profile

Actions

Bug #12728

closed

Report should have host_id, reported_at, status and metrics attr_accessible

Added by Shlomi Zadok over 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails
Target version:
Difficulty:
Triaged:
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 1 (0 open1 closed)

Related to Foreman - Bug #7568: Use attr_accessible for rails 4 upgradeClosedDaniel Lobato Garcia09/22/2014Actions
Actions #1

Updated by Dominic Cleal over 8 years ago

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

Updated by Dominic Cleal over 8 years ago

  • Category set to Rails

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

Actions #3

Updated by The Foreman Bot over 8 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
Actions #4

Updated by Shlomi Zadok over 8 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
Actions #5

Updated by Dominic Cleal over 8 years ago

  • translation missing: en.field_release set to 71

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

Actions #6

Updated by Shlomi Zadok over 8 years ago

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

Also available in: Atom PDF