diff --git a/lib/site_setting_extension.rb b/lib/site_setting_extension.rb index 016ddac9259..facb22bb4b4 100644 --- a/lib/site_setting_extension.rb +++ b/lib/site_setting_extension.rb @@ -310,8 +310,8 @@ module SiteSettingExtension type = get_data_type(name, defaults[name.to_sym]) if type == types[:fixnum] - # value should be less than 20000 - valid = false if value.to_i > 20000 + # validate fixnum + valid = false unless value.to_i.is_a?(Fixnum) end return valid diff --git a/spec/components/site_setting_extension_spec.rb b/spec/components/site_setting_extension_spec.rb index 695ad6fbc4c..d9509e7147e 100644 --- a/spec/components/site_setting_extension_spec.rb +++ b/spec/components/site_setting_extension_spec.rb @@ -340,12 +340,12 @@ describe SiteSettingExtension do end end - describe "set for an invalid fixnum value (greater than 20000)" do + describe "set for an invalid fixnum value" do it "raises an error" do settings.setting(:test_setting, 80) settings.refresh! expect { - settings.set("test_setting", 20001) + settings.set("test_setting", 9999999999999999999) }.to raise_error(ArgumentError) end end