Project

General

Profile

Bug #25351

NoMethodError on trends page

Added by Timo Goebel 20 days ago. Updated 15 days ago.

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

Description

NoMethodError: undefined method `hosts' for nil:NilClass
from app/models/trends/foreman_trend.rb:36:in `find_hosts'
from app/views/trends/_hosts.html.erb:1:in `_9bfd9ea732717462dcfbf0372a86b63c'
from action_view/template.rb:157:in `block in render'

Associated revisions

Revision badb4a7f (diff)
Added by Timo Goebel 15 days ago

fixes #25351 - load trends without associated object

History

#1 Updated by Timo Goebel 20 days ago

This happens because

#<ForemanTrend id: 182, trendable_type: "Operatingsystem", trendable_id: 3, name: nil, type: "ForemanTrend", fact_value: "CentOS 6.5", fact_name: nil, created_at: "2016-04-19 19:56:58", updated_at: "2016-04-19 19:56:58">

links to an OS that does not exist

Operatingsystem.where(id: 3)
=> #<ActiveRecord::Relation []>

#2 Updated by The Foreman Bot 20 days ago

  • Assignee set to Timo Goebel
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6185 added

#3 Updated by Tomer Brisker 15 days ago

  • Fixed in Releases 1.21.0 added

#4 Updated by Tomer Brisker 15 days ago

  • Fixed in Releases 1.19.1, 1.20.0 added
  • Fixed in Releases deleted (1.21.0)

#5 Updated by Timo Goebel 15 days ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF