From bda6e081de1db69482cd580ac6d38821540e65cd Mon Sep 17 00:00:00 2001 From: Muhammad Nawzad Date: Thu, 9 Nov 2023 10:19:29 +0300 Subject: [PATCH] Adds custom_defined_enum_method config to global configs --- lib/schemable/configuration.rb | 4 +++- sig/schemable/configuration.rbs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/schemable/configuration.rb b/lib/schemable/configuration.rb index 97e75b9..c302e68 100644 --- a/lib/schemable/configuration.rb +++ b/lib/schemable/configuration.rb @@ -7,7 +7,8 @@ module Schemable :float_as_string, :decimal_as_string, :custom_type_mappers, - :disable_factory_bot + :disable_factory_bot, + :custom_defined_enum_method ) def initialize @@ -17,6 +18,7 @@ module Schemable @custom_type_mappers = {} @decimal_as_string = false @disable_factory_bot = true + @custom_defined_enum_method = nil end def type_mapper(type_name) diff --git a/sig/schemable/configuration.rbs b/sig/schemable/configuration.rbs index 74a47ec..46a73e7 100644 --- a/sig/schemable/configuration.rbs +++ b/sig/schemable/configuration.rbs @@ -5,6 +5,7 @@ module Schemable attr_accessor float_as_string: bool attr_accessor decimal_as_string: bool attr_accessor disable_factory_bot: bool + attr_accessor custom_defined_enum_method: Symbol? attr_accessor custom_type_mappers: Hash[Symbol, any] def initialize: -> void