diff --git a/app/models/auto_track_duration_site_setting.rb b/app/models/auto_track_duration_site_setting.rb index ce4c7b68789..b40ff6e0eb7 100644 --- a/app/models/auto_track_duration_site_setting.rb +++ b/app/models/auto_track_duration_site_setting.rb @@ -3,6 +3,7 @@ require_dependency 'enum_site_setting' class AutoTrackDurationSiteSetting < EnumSiteSetting def self.valid_value?(val) + val.to_i.to_s == val.to_s && values.any? { |v| v[:value] == val.to_i } end diff --git a/app/models/digest_email_site_setting.rb b/app/models/digest_email_site_setting.rb index 5d0d40635a2..5276fe3b3eb 100644 --- a/app/models/digest_email_site_setting.rb +++ b/app/models/digest_email_site_setting.rb @@ -3,6 +3,7 @@ require_dependency 'enum_site_setting' class DigestEmailSiteSetting < EnumSiteSetting def self.valid_value?(val) + val.to_i.to_s == val.to_s && values.any? { |v| v[:value] == val.to_i } end diff --git a/app/models/new_topic_duration_site_setting.rb b/app/models/new_topic_duration_site_setting.rb index f04b9e67e5a..ccc091a8b66 100644 --- a/app/models/new_topic_duration_site_setting.rb +++ b/app/models/new_topic_duration_site_setting.rb @@ -3,6 +3,7 @@ require_dependency 'enum_site_setting' class NewTopicDurationSiteSetting < EnumSiteSetting def self.valid_value?(val) + val.to_i.to_s == val.to_s && values.any? { |v| v[:value] == val.to_i } end diff --git a/app/models/trust_level_setting.rb b/app/models/trust_level_setting.rb index 4b3e5d42e66..9ea838ad826 100644 --- a/app/models/trust_level_setting.rb +++ b/app/models/trust_level_setting.rb @@ -3,6 +3,7 @@ require_dependency 'enum_site_setting' class TrustLevelSetting < EnumSiteSetting def self.valid_value?(val) + val.to_i.to_s == val.to_s && valid_values.any? { |v| v == val.to_i } end