Project

General

Profile

« Previous | Next » 

Revision 8ae11ffa

Added by Ohad Levy almost 13 years ago

  • ID 8ae11fface3ac7f241b55174326073c78be203cb

fixes #1126 - addes full hostgroup name to hostgroup api

View differences:

app/models/hostgroup.rb
default_scope :order => 'LOWER(hostgroups.name)'
alias_attribute :os, :operatingsystem
alias_attribute :label, :to_label
acts_as_audited
scoped_search :on => :name, :complete_value => :true
......
classes
end
alias_method :to_label, :to_s
def to_label
return unless name
return name if ancestry.empty?
......
end
def as_json(options={})
super({:only => [:name, :id], :methods => [:classes, :parameters].concat(Vm::PROPERTIES), :include => [:environment]}.merge(options))
super({:only => [:name, :subnet_id, :domain_id, :id], :methods => [:label, :classes, :parameters].concat(Vm::PROPERTIES), :include => [:environment]}.merge(options))
end
def hostgroup

Also available in: Unified diff