Skip to content

_before_type_cast should return the default value if no custom value exists #15

@stex

Description

@stex

Currently, calling _before_type_cast on a setting_accessor will return nil if no custom value was set yet.

Instead, it should return the default value to mimic AR's behaviour.

The main reason to fix this is that Rails' text_field form helper looks for the attribute's ´value_before_type_cast` instead of just calling it - leading to an empty input field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions