Method: Subroutine::Fields::Configuration#get_default
- Defined in:
- lib/subroutine/fields/configuration.rb
#get_default ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/subroutine/fields/configuration.rb', line 53 def get_default value = config[:default] if value.respond_to?(:call) value = value.call elsif value.try(:duplicable?) # from active_support # Some classes of default values need to be duplicated, or the instance field value will end up referencing # the class global default value, and potentially modify it. value = value.deep_dup # from active_support end value end |