Project

General

Profile

« Previous | Next » 

Revision 6895854c

Added by Stephen Benjamin about 10 years ago

fixes #4256 - makes columns sortable in the UI

View differences:

app/models/concerns/host_common.rb
extend ActiveSupport::Concern
included do
belongs_to :architecture
belongs_to :environment
belongs_to :operatingsystem
counter_cache = "#{model_name.split(":").first.pluralize.downcase}_count".to_sym # e.g. :hosts_count
belongs_to :architecture, :counter_cache => counter_cache
belongs_to :environment, :counter_cache => counter_cache
belongs_to :operatingsystem, :counter_cache => counter_cache
belongs_to :medium
belongs_to :ptable
belongs_to :puppet_proxy, :class_name => "SmartProxy"
belongs_to :puppet_ca_proxy, :class_name => "SmartProxy"
belongs_to :domain
belongs_to :domain, :counter_cache => counter_cache
belongs_to :subnet
belongs_to :compute_profile

Also available in: Unified diff