5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 22:36:21 +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 def interval
@interval ||= begin @interval ||= begin
i = params[:interval]&.to_sym i = params[:interval]&.to_sym
Stat::INTERVALS.include?(i) ? i : :day Stat::INTERVALS.include?(i) ? i : Stat::INTERVALS.first
end end
end end
# @return [Symbol]
def resource def resource
@resource ||= begin @resource ||= begin
r = params[:resource].to_sym r = params[:resource].to_sym
Stat::RESOURCES.include?(r) ? r : :builds Stat::RESOURCES.include?(r) ? r : Stat::RESOURCES.first
end end
end end