lib/doggy/models/dashboard.rb in doggy-2.0.42 vs lib/doggy/models/dashboard.rb in doggy-2.1.0
- old
+ new
@@ -1,6 +1,7 @@
# encoding: utf-8
+# frozen_string_literal: true
module Doggy
module Models
class Dashboard < Doggy::Model
self.root = 'dash'
@@ -24,30 +25,27 @@
def refute_read_only!
self.read_only = false
end
def self.resource_url(id = nil)
- "https://app.datadoghq.com/api/v1/dash".tap do |base_url|
- base_url << "/#{ id }" if id
- end
+ "https://app.datadoghq.com/api/v1/dash/#{id}"
end
def managed?
!(title =~ Doggy::DOG_SKIP_REGEX)
end
def ensure_managed_emoji!
return unless managed?
- return if self.title =~ /\xF0\x9F\x90\xB6/
+ return if title =~ /\xF0\x9F\x90\xB6/
self.title += " \xF0\x9F\x90\xB6"
end
def human_url
- "https://#{Doggy.base_human_url}/dash/#{ id }"
+ "https://#{Doggy.base_human_url}/dash/#{id}"
end
# Dashboards don't have a direct edit URL
alias_method :human_edit_url, :human_url
end # Dashboard
end # Models
end # Doggy
-