Revision 104468b2
Added by Shlomi Zadok over 8 years ago
app/models/report.rb | ||
---|---|---|
include Authorizable
|
||
include ConfigurationStatusScopedSearch
|
||
|
||
attr_accessible :host, :reported_at, :status, :metrics
|
||
|
||
validates_lengths_from_database
|
||
belongs_to_host
|
||
has_many :messages, :through => :logs
|
test/unit/host_status/global_test.rb | ||
---|---|---|
|
||
test '.build(statuses, :last_reports => [reports]) uses reports cache for configuration statuses' do
|
||
status = HostStatus::ConfigurationStatus.new
|
||
report = Report.new(:host_id => 1)
|
||
report = Report.new(:host => Host.last)
|
||
status.expects(:relevant?).returns(true)
|
||
status.expects(:to_global).returns(:result)
|
||
global = HostStatus::Global.build([ status ], :last_reports => [ report ])
|
Also available in: Unified diff
Fixes #12728 - Add attr_accessible to Report