Project

General

Profile

Actions

Bug #302

closed

Fix count_habtm

Added by Frank Sweetser over 14 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

The new statistics page returned "No Inventory data has been found", which I tracked down to this line in count_habtm:

      label = eval(assocication.camelize).send("find",a[0].to_i).to_label if a[0]

causing this traceback:

NoMethodError: undefined method `to_label' for #<Puppetclass:0xb72bb1e8>
        from /usr/share/foreman/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
        from /usr/share/foreman/app/models/host.rb:375:in `count_habtm'
        from /usr/share/foreman/app/models/host.rb:373:in `each'
        from /usr/share/foreman/app/models/host.rb:373:in `count_habtm'

Changing the to_label to to_s fixed the glitch for me.


Files

Actions

Also available in: Atom PDF