File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,11 @@ class SettingsFormCoercible
4242 attr_reader :settings , :default_settings
4343 attr_accessor :coerced_settings
4444
45+ integer_klass = defined? ( Fixnum ) ? Fixnum : Integer
4546 COERCIONS_MAP = {
4647 String => Types ::Coercible ::String ,
4748 Symbol => Types ::CustomCoercions ::Symbol ,
48- ( 1 . class == Integer ? Integer : Fixnum ) => Types ::Params ::Integer ,
49+ integer_klass => Types ::Params ::Integer ,
4950 ActiveSupport ::HashWithIndifferentAccess => Types ::CustomCoercions ::Hash ,
5051 ActiveSupport ::Duration => Types ::Params ::Integer ,
5152 Float => Types ::Params ::Float ,
Original file line number Diff line number Diff line change @@ -19,8 +19,9 @@ class SettingsSchema < Dry::Validation::Schema::Params
1919 end
2020
2121 class SettingsFormValidator
22+ integer_klass = defined? ( Fixnum ) ? Fixnum : Integer
2223 VALIDATABLE_TYPES = {
23- ( 1 . class == Integer ? Integer : Fixnum ) => :int? ,
24+ integer_klass => :int? ,
2425 Float => :float? ,
2526 ActiveSupport ::Duration => :int? ,
2627 ActiveSupport ::HashWithIndifferentAccess => :form_hash?
Original file line number Diff line number Diff line change @@ -11,10 +11,11 @@ module RailsSettingsUi
1111 class UnknownDefaultValueType < StandardError ; end
1212
1313 class TypeConverter
14+ integer_klass = defined? ( Fixnum ) ? Fixnum : Integer
1415 VALUE_TYPES_MAP = {
1516 String => RailsSettingsUi ::ValueTypes ::String ,
1617 Symbol => RailsSettingsUi ::ValueTypes ::Symbol ,
17- Fixnum => RailsSettingsUi ::ValueTypes ::Fixnum ,
18+ integer_klass => RailsSettingsUi ::ValueTypes ::Fixnum ,
1819 # ActiveSupport::HashWithIndifferentAccess => RailsSettingsUi::ValueTypes::Hash,
1920 ActiveSupport ::Duration => RailsSettingsUi ::ValueTypes ::Float ,
2021 Float => RailsSettingsUi ::ValueTypes ::Float ,
You can’t perform that action at this time.
0 commit comments