Skip to content

Commit

Permalink
fixes #13883 - replace :order association option with block
Browse files Browse the repository at this point in the history
Already deprecated in an earlier Rails release, :order in an
association should be replaced by a scope block calling order().
  • Loading branch information
domcleal authored and dLobatog committed Mar 1, 2016
1 parent 4a4c48e commit 3d2098b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/host/managed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Host::Managed < Host::Base
has_many :puppetclasses, :through => :host_classes, :dependent => :destroy
belongs_to :hostgroup, :counter_cache => :hosts_count
has_many :reports, :foreign_key => :host_id, :class_name => 'ConfigReport'
has_one :last_report_object, :foreign_key => :host_id, :order => "#{Report.table_name}.id DESC", :class_name => 'ConfigReport'
has_one :last_report_object, -> { order("#{Report.table_name}.id DESC") }, :foreign_key => :host_id, :class_name => 'ConfigReport'

belongs_to :owner, :polymorphic => true
belongs_to :compute_resource
Expand Down

0 comments on commit 3d2098b

Please sign in to comment.