Revision aa1796f3
Added by Paul Kelly almost 14 years ago
- ID aa1796f3efcd11e491ee2e55a91e6ae86529e8ea
app/models/host_parameter.rb | ||
---|---|---|
class HostParameter < Parameter
|
||
belongs_to :host
|
||
validates_presence_of :host_id, :message => "parameters require an associated host", :unless => :nested
|
||
validates_uniqueness_of :name, :scope => :host_id
|
||
belongs_to :host, :foreign_key => :reference_id
|
||
validates_uniqueness_of :name, :scope => :reference_id
|
||
|
||
def to_s
|
||
"#{host_id ? host.name : "unassociated"}: #{name} = #{value}"
|
Also available in: Unified diff
Fixes #261 - parameters now use a single reference_id
This implementation uses STI but the table looks the same for all
variants. This is a little strange but it seems to work.
Also removed obsolete controllers and tests
Added more tests