Bug #302

Fix count_habtm

Added by Frank Sweetser 3 months ago. Updated 3 months ago.

Status:Closed Start:06/02/2010
Priority:Normal Due date:
Assigned to:Ohad Levy % Done:

100%

Category:-
Target version:0.1-5
Branch:

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.

0001-Change-to_label-to-to_s-in-count_habtm.patch (878 Bytes) Frank Sweetser, 06/02/2010 08:05 pm

Associated revisions

Revision 81e2d3f3f6059d9d4807e57011769ad016d6c2d5
Added by Ohad Levy 3 months ago

fixes #302 and all references to_label and to_s
removed references to all per_page settings as they are common now

History

Updated by Ohad Levy 3 months ago

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

Updated by Ohad Levy 3 months ago

  • Assigned to set to Ohad Levy
  • Target version set to 0.1-5

Updated by Ohad Levy 3 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF