5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-06-02 08:04:17 +00:00

parametros por defecto

This commit is contained in:
f 2022-04-26 16:56:45 -03:00
parent 0754e29a5a
commit 7e575372cf

View file

@ -162,14 +162,15 @@ class StatsController < ApplicationController
def interval
@interval ||= begin
i = params[:interval]&.to_sym
Stat::INTERVALS.include?(i) ? i : :day
Stat::INTERVALS.include?(i) ? i : Stat::INTERVALS.first
end
end
# @return [Symbol]
def resource
@resource ||= begin
r = params[:resource].to_sym
Stat::RESOURCES.include?(r) ? r : :builds
Stat::RESOURCES.include?(r) ? r : Stat::RESOURCES.first
end
end