lib/doggy/cli/unmute.rb in doggy-2.0.36 vs lib/doggy/cli/unmute.rb in doggy-2.0.37
- old
+ new
@@ -2,16 +2,17 @@
module Doggy
class CLI::Unmute
def initialize(options, ids)
@options = options
- @ids = ids
+ @ids = ids
end
def run
monitors = @ids.map { |id| Doggy::Models::Monitor.find(id) }
- monitors.each { |monitor| monitor.toggle_mute!('unmute') }
+ body = {}
+ body[:all_scopes] = true if @options['all_scopes']
+ body[:scope] = @options['scope'] if @options['scope']
+ monitors.each { |monitor| monitor.toggle_mute!('unmute', JSON.dump(body)) }
end
end
end
-
-