lib/nagios.rb in nagios_helper-0.2.1 vs lib/nagios.rb in nagios_helper-0.2.2
- old
+ new
@@ -48,10 +48,18 @@
def status_name(status)
":#{ STATUS_NAMES[status] || 'unknown' }"
end
def rails_root
- @rails_root ||= defined?(RAILS_ROOT) ? RAILS_ROOT : (defined?(Rails) ? Rails.root : nil)
+ @rails_root ||= begin
+ if defined?(RAILS_ROOT)
+ RAILS_ROOT
+ elsif defined?(Rails)
+ Rails.root
+ elsif defined?(Application)
+ Application.root
+ end
+ end
end
def rails_root=(rails_root)
@rails_root = rails_root
end