Project

General

Profile

Refactor #13883

Host::Managed.last_report_object association uses deprecated :order parameter

Added by Dominic Cleal 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

The last_report_object association on Host::Managed uses a deprecated :order parameter, but should use a scope block and call the order() method, e.g.

has_one :last_report_object, ... :order => "#{Report.table_name}.id DESC"

becomes

has_one :last_report_object, -> { order("#{Report.table_name}.id DESC") }

The interfaces association in Host::Base was already changed like this in #7230.


Related issues

Related to Foreman - Bug #14012: Errors on hosts status, configuration status is out of syncClosed2016-03-02
Has duplicate Foreman - Bug #14352: Configuration status is getting marked out of sync incorrectlyDuplicate2016-03-24
Blocks Foreman - Feature #13244: Upgrade Ruby on Rails to 4.2Closed2016-01-15

Associated revisions

Revision 3d2098bd (diff)
Added by Dominic Cleal over 3 years ago

fixes #13883 - replace :order association option with block

Already deprecated in an earlier Rails release, :order in an
association should be replaced by a scope block calling order().

Revision 994a1dcc (diff)
Added by Dominic Cleal over 3 years ago

fixes #13883 - replace :order association option with block

Already deprecated in an earlier Rails release, :order in an
association should be replaced by a scope block calling order().

(cherry picked from commit 3d2098bd472851ce4d030ff78adc30044eaa7d3b)

History

#1 Updated by The Foreman Bot over 3 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3234 added

#2 Updated by Dominic Cleal over 3 years ago

#3 Updated by Dominic Cleal over 3 years ago

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

#4 Updated by Dominic Cleal over 3 years ago

  • Legacy Backlogs Release (now unused) set to 136

#5 Updated by Marek Hulán over 3 years ago

  • Related to Bug #14012: Errors on hosts status, configuration status is out of sync added

#6 Updated by Dominic Cleal over 3 years ago

  • Legacy Backlogs Release (now unused) changed from 136 to 71

#7 Updated by Stephen Benjamin over 3 years ago

  • Has duplicate Bug #14352: Configuration status is getting marked out of sync incorrectly added

#8 Updated by Stephen Benjamin over 3 years ago

  • Bugzilla link set to 14352

#9 Updated by Stephen Benjamin over 3 years ago

  • Bugzilla link changed from 14352 to 1321104

Also available in: Atom PDF