Skip to content

Commit

Permalink
Replace default_value_for with simple fetch defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
jrafanie committed Feb 29, 2024
1 parent 0869343 commit 760f8df
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/models/time_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ class TimeProfile < ApplicationRecord
DEFAULT_TZ = "UTC".freeze

serialize :profile
default_value_for :days, ALL_DAYS
default_value_for :hours, ALL_HOURS

has_many :miq_reports
has_many :metric_rollups
Expand Down Expand Up @@ -75,7 +73,7 @@ def tz_or_default(default_tz = DEFAULT_TZ)
end

def days
profile[:days]
profile.fetch(:days, ALL_DAYS)
end

def days=(arr)
Expand All @@ -85,7 +83,7 @@ def days=(arr)
end

def hours
profile[:hours]
profile.fetch(:hours, ALL_HOURS)
end

def hours=(arr)
Expand Down

0 comments on commit 760f8df

Please sign in to comment.