Files
national-parks-api/app/controllers/api/v1/stats_controller.rb
2025-10-08 09:50:33 -07:00

11 lines
285 B
Ruby

module Api::V1
class StatsController < BaseController
def index
@park_count = Park.count
@alert_count = Alert.count
@state_with_most_parks = ParksByState.group(:state).count.max
@park_with_most_alerts = Alert.group(:park_code).count.max
end
end
end