fluent/fluentd-ui

View on GitHub
app/controllers/polling_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class PollingController < ApplicationController
  def alerts
    alerts = []

    %w{ installing uninstalling }.each do |action|
      send("#{action}_gems").each do |plugin|
        target = plugin.gem_name.dup
        target << "(#{plugin.version})" if plugin.version
        alerts << {
          text: I18n.t("terms.#{action}", target: target)
        }
      end
    end

    render json: alerts
  end
end